feat: PART III 랜딩 피봇 — 다채널 URL 입력 + Strategic Planner 포지셔닝
- MultiChannelInput: URL 뭉치 붙여넣기 → classifyUrls로 7개 채널 자동 분류
(homepage·YouTube·Instagram·Facebook·네이버플레이스·블로그·강남언니)
· "Analyze" pill 버튼 복원 + variant별 색 분기 (hero=dark brand,
cta=#fff3eb→#e4cfff→#f5f9ff warm 3-stop)
· placeholder 중앙 정렬 + "한 줄씩" 규칙 제거 (유연 파싱 노출)
- Navbar: Free Report CTA 제거 → Login + 문의하기 (contact@o2o.kr) duo
- LoginPage: 계약 고객용 스캐폴딩 페이지 신규 추가
- PricingPage: 계약 기반 영업 반영, FAQ에서 해지·환불 항목 제거
(세부 정책 미확정 → 후속 추가)
- Landing 카피 Strategic Planner 포지셔닝 피봇:
· Hero sub: "10분 진단 → 12개월 전략 설계"
· Solution AGDP: Audit / Generation / Direction / Planning 재해석
· Modules: Intelligence + Planning Available, 나머지 Coming Soon 정직화
· TargetAudience: 전략 파트너 / 전략 자문 + Partner Program 신청 waitlist
· Problems: 콘텐츠 소진 / 경쟁사 분석 부재 / 데이터 부족 3축
· UseCases: 진단·전략·KPI(Medical) · 수주·자문·포트폴리오(Agency)
- discover-channels Edge Function: manualChannels 수용 — 사용자 붙여넣은
URL이 Firecrawl 스크래핑보다 우선, naverPlace/gangnamUnni 직접 주입
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
517075b3ef
commit
938ebacbf9
20 files changed
+1774
-146
No files matched your search
@@ -0,0 +1,213 @@
|
||||
/**
|
||||
* MultiChannelInput — 랜딩 Hero / CTA 공용 멀티 URL 입력 컴포넌트.
|
||||
*
|
||||
* 설계 배경 (PART III 피봇):
|
||||
* - 기존 Hero/CTA의 단일 URL input은 "홈페이지 URL → 자동 SNS 발견"을 전제로 했지만,
|
||||
* 영업 현장에서는 병원이 본인들의 YouTube/Instagram/FB/네이버플레이스/블로그/강남언니 URL을
|
||||
* 이미 알고 있는 경우가 많아 이를 직접 받는 편이 정확도·속도 면에서 우월합니다.
|
||||
* - Hero와 CTA가 동일한 입력 로직(url state + handleAnalyze + navigate)을 **중복 구현**하던
|
||||
* 문제를 이 컴포넌트 하나로 해소합니다.
|
||||
*
|
||||
* 동작:
|
||||
* 1) Textarea에 URL을 공백/쉼표/줄바꿈으로 구분해 붙여넣기
|
||||
* 2) `classifyUrls()`로 실시간 7채널 분류 (`useMemo`)
|
||||
* 3) 채널별 칩 프리뷰 — 검출 건수 표시, unknown URL은 경고
|
||||
* 4) "채널 분석 시작" 버튼 클릭 → onAnalyze(payload) 호출 (부모가 navigation 처리)
|
||||
*
|
||||
* DS 준수:
|
||||
* - Filled Icons Only (lucide 무단 사용 금지 — 이모지·outlined 금지)
|
||||
* - DS Primary pill: rounded-full + gradient `from-[#4F1DA1] to-[#021341]`
|
||||
* - variant='hero': 글래스 배경 (랜딩 Hero)
|
||||
* - variant='cta': 다크 배경 (CTA 섹션)
|
||||
*/
|
||||
|
||||
import { useMemo, useState, type ReactElement } from 'react';
|
||||
import { ArrowRight } from 'lucide-react';
|
||||
import {
|
||||
GlobeFilled,
|
||||
YoutubeFilled,
|
||||
InstagramFilled,
|
||||
FacebookFilled,
|
||||
DatabaseFilled,
|
||||
FileTextFilled,
|
||||
MessageFilled,
|
||||
WarningFilled,
|
||||
} from './icons/FilledIcons';
|
||||
import {
|
||||
classifyUrls,
|
||||
hasAnalyzableChannels,
|
||||
pickPrimaryUrl,
|
||||
type ClassifiedUrls,
|
||||
} from '../lib/classifyUrls';
|
||||
|
||||
/** discover-channels Edge Function에 전달되는 수동 채널 URL 묶음. */
|
||||
export interface ManualChannels {
|
||||
youtube?: string[];
|
||||
instagram?: string[];
|
||||
facebook?: string[];
|
||||
naverPlace?: string[];
|
||||
naverBlog?: string[];
|
||||
gangnamUnni?: string[];
|
||||
}
|
||||
|
||||
export interface AnalyzePayload {
|
||||
/** discover-channels `url` 필드 (필수) — 홈페이지 우선, 없으면 첫 SNS URL. */
|
||||
primaryUrl: string;
|
||||
/** 사용자가 제공한 채널별 URL — Edge Function이 Firecrawl discovery를 스킵. */
|
||||
manualChannels: ManualChannels;
|
||||
/** 사용자 원본 입력 (디버깅·재실행용) */
|
||||
rawInput: string;
|
||||
}
|
||||
|
||||
interface MultiChannelInputProps {
|
||||
variant?: 'hero' | 'cta';
|
||||
onAnalyze: (payload: AnalyzePayload) => void;
|
||||
}
|
||||
|
||||
/** 채널 칩 메타 — 렌더링 순서·아이콘·한글명. */
|
||||
const CHANNEL_META: Array<{
|
||||
key: keyof Omit<ClassifiedUrls, 'unknown'>;
|
||||
label: string;
|
||||
Icon: (props: { size?: number; className?: string }) => ReactElement;
|
||||
color: string; // 활성화 시 텍스트/아이콘 색
|
||||
}> = [
|
||||
{ key: 'homepage', label: '홈페이지', Icon: GlobeFilled, color: 'text-[#4F1DA1]' },
|
||||
{ key: 'youtube', label: 'YouTube', Icon: YoutubeFilled, color: 'text-[#FF0000]' },
|
||||
{ key: 'instagram', label: 'Instagram', Icon: InstagramFilled,color: 'text-[#E1306C]' },
|
||||
{ key: 'facebook', label: 'Facebook', Icon: FacebookFilled, color: 'text-[#1877F2]' },
|
||||
{ key: 'naverPlace', label: '네이버 플레이스', Icon: DatabaseFilled, color: 'text-[#03C75A]' },
|
||||
{ key: 'naverBlog', label: '네이버 블로그', Icon: FileTextFilled, color: 'text-[#03C75A]' },
|
||||
{ key: 'gangnamUnni', label: '강남언니', Icon: MessageFilled, color: 'text-[#FF5C89]' },
|
||||
];
|
||||
|
||||
export default function MultiChannelInput({ variant = 'hero', onAnalyze }: MultiChannelInputProps) {
|
||||
const [text, setText] = useState('');
|
||||
|
||||
// 실시간 분류 — text가 바뀔 때만 재계산.
|
||||
const classified = useMemo(() => classifyUrls(text), [text]);
|
||||
|
||||
const canAnalyze = hasAnalyzableChannels(classified);
|
||||
const primaryUrl = pickPrimaryUrl(classified);
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (!canAnalyze || !primaryUrl) return;
|
||||
const payload: AnalyzePayload = {
|
||||
primaryUrl,
|
||||
manualChannels: {
|
||||
// homepage는 primaryUrl로 들어가므로 manualChannels에서는 제외 (Edge Function에서 `url`을 쓰므로)
|
||||
youtube: classified.youtube.length ? classified.youtube : undefined,
|
||||
instagram: classified.instagram.length ? classified.instagram : undefined,
|
||||
facebook: classified.facebook.length ? classified.facebook : undefined,
|
||||
naverPlace: classified.naverPlace.length ? classified.naverPlace : undefined,
|
||||
naverBlog: classified.naverBlog.length ? classified.naverBlog : undefined,
|
||||
gangnamUnni: classified.gangnamUnni.length ? classified.gangnamUnni : undefined,
|
||||
},
|
||||
rawInput: text,
|
||||
};
|
||||
onAnalyze(payload);
|
||||
};
|
||||
|
||||
// variant별 스타일 토큰
|
||||
// ▸ `text-center` 추가 (원본 Hero 단일 URL input과 일관): Form 필드가 아닌
|
||||
// "검색창 같은 자유 입력" 시그널로 전환. placeholder 여러 줄도 중앙 정렬.
|
||||
const isHero = variant === 'hero';
|
||||
const textareaClass = isHero
|
||||
? 'w-full px-6 py-4 text-sm md:text-base text-center bg-white/80 backdrop-blur-sm border border-slate-200 rounded-2xl focus:outline-none focus:ring-2 focus:ring-accent/20 focus:border-accent/40 shadow-sm text-primary-900 placeholder:text-slate-400 transition-all resize-none leading-relaxed'
|
||||
: 'w-full px-6 py-4 text-sm md:text-base text-center bg-white/5 backdrop-blur-sm border border-white/15 rounded-2xl focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/60 text-white placeholder:text-white/40 transition-all resize-none leading-relaxed';
|
||||
|
||||
const helperClass = isHero ? 'text-slate-500' : 'text-white/60';
|
||||
const chipInactiveBg = isHero ? 'bg-slate-50 border-slate-100' : 'bg-white/5 border-white/10';
|
||||
const chipInactiveText = isHero ? 'text-slate-400' : 'text-white/40';
|
||||
const chipActiveBg = isHero ? 'bg-white border-slate-200 shadow-sm' : 'bg-white/10 border-white/25';
|
||||
const chipActiveText = isHero ? 'text-primary-900' : 'text-white';
|
||||
|
||||
return (
|
||||
<div className="w-full max-w-2xl mx-auto">
|
||||
{/* URL Textarea
|
||||
Placeholder 카피 원칙: "한 줄씩" 같은 입력 규칙 제거.
|
||||
classifyUrls.ts가 공백·쉼표·줄바꿈·임의 텍스트 섞임 모두 처리하므로
|
||||
사용자에게 입력 형식 고민을 넘기지 않고, "뭉치 → 자동 분류" 를 제품 약속으로 선언.
|
||||
정렬: `text-center` — 원본 Hero의 단일 URL input과 일관, Form 필드 인상을 줄여
|
||||
"검색창 같은 자유 입력" 느낌으로 전환. */}
|
||||
<textarea
|
||||
value={text}
|
||||
onChange={(e) => setText(e.target.value)}
|
||||
placeholder={
|
||||
'URL을 한 번에 붙여넣어 주세요\n홈페이지 · YouTube · Instagram · Facebook · 네이버 플레이스 · 블로그 · 강남언니를 AI가 자동으로 분류합니다'
|
||||
}
|
||||
rows={5}
|
||||
className={textareaClass}
|
||||
spellCheck={false}
|
||||
/>
|
||||
|
||||
{/* 채널 칩 프리뷰 */}
|
||||
<div className="flex flex-wrap gap-2 mt-4 justify-center">
|
||||
{CHANNEL_META.map(({ key, label, Icon, color }) => {
|
||||
const count = classified[key].length;
|
||||
const isActive = count > 0;
|
||||
return (
|
||||
<div
|
||||
key={key}
|
||||
className={`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full border text-xs font-semibold transition-all ${
|
||||
isActive ? `${chipActiveBg} ${chipActiveText}` : `${chipInactiveBg} ${chipInactiveText}`
|
||||
}`}
|
||||
>
|
||||
<Icon size={14} className={isActive ? color : ''} />
|
||||
<span>{label}</span>
|
||||
{isActive && (
|
||||
<span className={`ml-0.5 px-1.5 py-0.5 text-[10px] rounded-full bg-accent/10 text-accent`}>
|
||||
{count}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Unknown URL 경고 */}
|
||||
{classified.unknown.length > 0 && (
|
||||
<div
|
||||
className={`flex items-start gap-2 mt-3 px-4 py-3 rounded-xl border ${
|
||||
isHero
|
||||
? 'bg-amber-50/80 border-amber-200 text-amber-800'
|
||||
: 'bg-amber-500/10 border-amber-400/30 text-amber-100'
|
||||
}`}
|
||||
>
|
||||
<WarningFilled size={16} className={isHero ? 'text-amber-500 shrink-0 mt-0.5' : 'text-amber-300 shrink-0 mt-0.5'} />
|
||||
<div className="text-xs leading-relaxed break-keep">
|
||||
<span className="font-semibold">분석 대상이 아닌 URL {classified.unknown.length}건</span>이 있어요.
|
||||
(게시물·검색 페이지·미지원 플랫폼 등) — 해당 URL은 제외하고 진행합니다.
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 분석 시작 버튼 — "Analyze" pill. 모양·크기는 원본 CTA 스펙 고정.
|
||||
▸ 모양·크기·너비: `rounded-full px-10 py-4 text-lg font-medium`, `max-w-md` (~448px) 캡
|
||||
▸ 색 (variant별 분기 — 대비 + 브랜드 시그니처 통일):
|
||||
- hero (라이트 배경): 다크 브랜드 `#4F1DA1 → #021341` + `text-white`,
|
||||
hover 시 `#AF90FF` 라벤더 단색 — 밝기 역전
|
||||
- cta (다크 `bg-primary-900` 배경): 브랜드 시그니처 3-stop warm gradient
|
||||
`#fff3eb → #e4cfff → #f5f9ff` + `text-primary-900`,
|
||||
이미 Hero/CTA 헤드라인 텍스트와 동일 팔레트라 섹션 내 색언어 통일.
|
||||
이미 밝은 톤이라 hover 밝기 역전 불가 → `hover:scale-[1.02]` + `shadow-2xl` 로 부양 피드백.
|
||||
▸ disabled: HTML `disabled` 속성만, opacity 변화 없음 (46b911d 원칙) */}
|
||||
<button
|
||||
onClick={handleSubmit}
|
||||
disabled={!canAnalyze}
|
||||
className={`w-full max-w-md mx-auto mt-5 px-10 py-4 text-lg font-medium rounded-full transition-all duration-150 shadow-xl hover:shadow-2xl flex items-center justify-center gap-2 group bg-gradient-to-r active:scale-[0.98] ${
|
||||
isHero
|
||||
? 'from-[#4F1DA1] to-[#021341] text-white hover:from-[#AF90FF] hover:to-[#AF90FF]'
|
||||
: 'from-[#fff3eb] via-[#e4cfff] to-[#f5f9ff] text-primary-900 hover:scale-[1.02]'
|
||||
}`}
|
||||
>
|
||||
Analyze
|
||||
<ArrowRight className="w-5 h-5 group-hover:translate-x-1" />
|
||||
</button>
|
||||
|
||||
{/* 보조 안내 */}
|
||||
<p className={`text-xs font-medium mt-3 text-center leading-relaxed break-keep ${helperClass}`}>
|
||||
네이버 블로그 · 플레이스 · 소셜미디어 등 Online Presence 종합 분석 리포트를 제공합니다.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user