"use client"; import { Ban, ExternalLink, HelpCircle, Layers, Target, UserCircle, Users, } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { SIMILAR_ACCOUNT_SOURCE_LABELS, threadsProfileUrl, type ResearchMap, } from "@/lib/types/research"; import { cn } from "@/lib/utils"; interface ResearchMapViewProps { map: ResearchMap; /** 置入模式不顯示相似帳號(僅爆款模仿需要) */ showSimilarAccounts?: boolean; } function HeroBlock({ icon, label, children, }: { icon: React.ReactNode; label: string; children: React.ReactNode; }) { return (
{icon}

{label}

{children}

); } function MapBlock({ icon, title, count, children, className, tone = "default", }: { icon: React.ReactNode; title: string; count?: number; children: React.ReactNode; className?: string; tone?: "default" | "exclude"; }) { return (
{icon}

{title}

{count !== undefined && count > 0 && ( {count} )}
{children}
); } export function ResearchMapView({ map, showSimilarAccounts = true }: ResearchMapViewProps) { const accounts = showSimilarAccounts ? (map.similarAccounts ?? []) : []; return (
} label="受眾是誰"> {map.audienceSummary} } label="內容目標"> {map.contentGoal}
{map.questions.length > 0 && ( } title="受眾會問什麼" count={map.questions.length} className="md:col-span-1 xl:col-span-1" >
    {map.questions.map((q, i) => (
  1. {i + 1} {q}
  2. ))}
)} {map.pillars.length > 0 && ( } title="內容支柱" count={map.pillars.length} >
{map.pillars.map((p) => ( {p} ))}
)} {map.exclusions.length > 0 && ( } title="不要碰" count={map.exclusions.length} tone="exclude" >
    {map.exclusions.map((ex) => (
  • × {ex}
  • ))}
)}
{showSimilarAccounts && ( } title="相似帳號" count={accounts.length} > {accounts.length > 0 ? (
{accounts.map((a) => { const profileUrl = a.profileUrl ?? threadsProfileUrl(a.username); const sourceLabel = a.source ? SIMILAR_ACCOUNT_SOURCE_LABELS[a.source] : null; return (
{profileUrl ? ( @{a.username} ) : ( @{a.username} )} {sourceLabel && ( {sourceLabel} )}
{a.postUrl ? ( {a.reason} ) : (

{a.reason}

)}
); })}
) : (

尚未找到相似帳號,可重試分析或在微調面板手動加入 @帳號

)}
)}
); }