브랜드 분석 페이지 수정, ado2 컨텐츠 추가, header jwt 인증 작업 .
This commit is contained in:
1 parent
7d4f3c7e05
commit
7ee911f0aa
7 files changed
+865
-139
No files matched your search
@@ -2,7 +2,6 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import { CrawlingResponse } from '../../types/api';
|
||||
import GeometricChart, { USP } from './GeometricChart';
|
||||
import KeywordBubble from './KeywordBubble';
|
||||
|
||||
interface AnalysisResultSectionProps {
|
||||
onBack: () => void;
|
||||
@@ -74,11 +73,12 @@ const parseMarkdownBlocks = (text: string): MarkdownBlock[] => {
|
||||
};
|
||||
|
||||
const renderInlineMarkdown = (text: string): React.ReactNode[] => {
|
||||
const parts = text.split(/(\*\*[^*]+\*\*|`[^`]+`|#[^\s#]+)/g).filter(Boolean);
|
||||
// Use non-greedy .+? instead of [^*]+ to handle edge cases better
|
||||
const parts = text.split(/(\*\*.+?\*\*|`[^`]+`|#[^\s#]+)/g).filter(Boolean);
|
||||
return parts.map((part, idx) => {
|
||||
if (part.startsWith('**') && part.endsWith('**')) {
|
||||
return (
|
||||
<strong key={idx} className="text-white">
|
||||
<strong key={idx} className="text-white font-semibold">
|
||||
{part.slice(2, -2)}
|
||||
</strong>
|
||||
);
|
||||
@@ -245,12 +245,6 @@ const buildTargets = (sectionText: string, tags: string[]) => {
|
||||
});
|
||||
};
|
||||
|
||||
const ArrowLeftIcon = () => (
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<path d="M15 18l-6-6 6-6" />
|
||||
</svg>
|
||||
);
|
||||
|
||||
const SparklesIcon = ({ className = '' }: { className?: string }) => (
|
||||
<svg className={className} viewBox="0 0 24 24" fill="currentColor" aria-hidden>
|
||||
<path d="M12 2l2.4 6.8L22 12l-7.6 3.2L12 22l-2.4-6.8L2 12l7.6-3.2L12 2z" />
|
||||
@@ -280,12 +274,6 @@ const UsersIcon = () => (
|
||||
</svg>
|
||||
);
|
||||
|
||||
const CrownIcon = ({ className = '' }: { className?: string }) => (
|
||||
<svg className={className} viewBox="0 0 24 24" fill="currentColor" aria-hidden>
|
||||
<path d="M3 7l4 4 5-6 5 6 4-4v10H3z" />
|
||||
</svg>
|
||||
);
|
||||
|
||||
const TrendingUpIcon = () => (
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<path d="M3 17l6-6 4 4 7-7" />
|
||||
@@ -327,12 +315,11 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-brand-bg text-brand-text pb-24 selection:bg-brand-accent/30 font-sans">
|
||||
<div className="p-6">
|
||||
<button
|
||||
onClick={onBack}
|
||||
className="flex items-center gap-2 px-4 py-2 rounded-full border border-brand-muted/30 text-brand-muted hover:text-brand-accent hover:border-brand-accent transition-all text-sm group"
|
||||
>
|
||||
<ArrowLeftIcon />
|
||||
<div className="asset-header">
|
||||
<button onClick={onBack} className="btn-back-new">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<path d="M15 18l-6-6 6-6" />
|
||||
</svg>
|
||||
<span>뒤로가기</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -345,7 +332,7 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
||||
</div>
|
||||
<h1 className="text-4xl font-bold mb-3 tracking-tight text-white">브랜드 인텔리전스</h1>
|
||||
<p className="text-brand-muted text-lg max-w-xl mx-auto">
|
||||
<span className="text-brand-accent font-semibold">AI 데이터 분석</span>을 통해 도출된 브랜드 전략입니다.
|
||||
<span className="text-brand-accent font-semibold">AI 데이터 분석</span>을 통해 도출된 {processed_info.customer_name}의 핵심 전략입니다.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -390,11 +377,11 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
||||
<span className="block text-xs text-brand-muted mb-1 group-hover:text-brand-accent transition-colors">
|
||||
카테고리 정의
|
||||
</span>
|
||||
<span className="font-bold text-lg text-white">{positioningCategory}</span>
|
||||
<div className="font-bold text-lg text-white">{renderMarkdown(positioningCategory)}</div>
|
||||
</div>
|
||||
<div className="bg-gradient-to-r from-brand-bg/50 to-brand-cardHover p-5 rounded-xl border border-brand-muted/20 border-l-4 border-l-brand-accent">
|
||||
<span className="block text-xs text-brand-accent mb-1 font-semibold">핵심 가치 (Core Value)</span>
|
||||
<span className="font-semibold text-white">{positioningCore}</span>
|
||||
<div className="font-semibold text-white">{renderMarkdown(positioningCore)}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -411,7 +398,7 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
||||
>
|
||||
<div className="min-w-[120px]">
|
||||
<div className="font-bold text-white group-hover:text-brand-accent transition-colors">
|
||||
{target.segment}
|
||||
{renderInlineMarkdown(target.segment)}
|
||||
</div>
|
||||
{target.age && <div className="text-xs text-brand-muted">{target.age}</div>}
|
||||
</div>
|
||||
@@ -423,14 +410,14 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
||||
key={i}
|
||||
className="text-[10px] px-2 py-0.5 bg-brand-accent/10 text-brand-accent rounded-sm font-medium"
|
||||
>
|
||||
{need}
|
||||
{renderInlineMarkdown(need)}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
{target.triggers.length > 0 && (
|
||||
<p className="text-xs text-gray-400 border-t border-white/5 pt-2 mt-2">
|
||||
<span className="text-brand-muted">Trigger:</span> {target.triggers.join(', ')}
|
||||
<span className="text-brand-muted">Trigger:</span> {target.triggers.map((t: string, i: number) => <span key={i}>{i > 0 && ', '}{renderInlineMarkdown(t)}</span>)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
@@ -444,10 +431,6 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
||||
<div className="bg-brand-card rounded-3xl p-8 border border-brand-muted/10 min-h-[500px] flex flex-col relative overflow-hidden">
|
||||
<div className="flex justify-between items-center mb-2 z-10">
|
||||
<h3 className="text-xl font-bold text-white">주요 셀링 포인트 (USP)</h3>
|
||||
<div className="flex items-center gap-1 text-xs text-brand-accent bg-brand-accent/10 px-2 py-1 rounded">
|
||||
<TrendingUpIcon />
|
||||
<span>AI Data Analysis</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 flex items-center justify-center relative z-10 -my-4">
|
||||
@@ -455,51 +438,56 @@ const AnalysisResultSection: React.FC<AnalysisResultSectionProps> = ({ onBack, o
|
||||
</div>
|
||||
|
||||
{topUSP && (
|
||||
<div className="mt-2 mb-6 p-4 rounded-xl bg-gradient-to-r from-brand-accent/10 to-transparent border border-brand-accent/20 relative overflow-hidden">
|
||||
<div className="absolute top-0 right-0 p-2 opacity-10">
|
||||
<CrownIcon className="w-16 h-16 text-brand-accent" />
|
||||
</div>
|
||||
<div className="relative z-10">
|
||||
<div className="text-xs text-brand-accent font-bold uppercase tracking-wider mb-1 flex items-center gap-1">
|
||||
<CrownIcon className="w-3 h-3" /> Core Competitiveness
|
||||
</div>
|
||||
<div className="flex justify-between items-end">
|
||||
<div>
|
||||
<div className="text-lg font-bold text-white">{topUSP.label}</div>
|
||||
<div className="text-xs text-brand-accent/80 font-mono tracking-wider">{topUSP.subLabel}</div>
|
||||
<div className="mt-2 mb-6 p-4 rounded-xl bg-brand-card border border-brand-muted/20 relative overflow-hidden">
|
||||
<div className="relative z-10 flex justify-between items-center">
|
||||
<div>
|
||||
<div className="flex items-center gap-2 mb-2">
|
||||
<span className="text-xs text-brand-accent font-bold uppercase tracking-wider">{topUSP.subLabel}</span>
|
||||
<span className="text-xs bg-brand-muted/30 text-white px-2 py-0.5 rounded font-semibold">CORE</span>
|
||||
</div>
|
||||
<div className="text-lg font-bold text-white mb-1">{topUSP.label}</div>
|
||||
<div className="text-sm text-brand-muted">{topUSP.description}</div>
|
||||
</div>
|
||||
<div className="text-4xl font-bold text-brand-muted">{topUSP.score}</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="grid grid-cols-2 gap-3 z-10">
|
||||
<div className="space-y-3 z-10">
|
||||
{usps
|
||||
.filter((usp) => usp.label !== topUSP?.label)
|
||||
.slice(0, 4)
|
||||
.map((usp, idx) => (
|
||||
<div
|
||||
key={idx}
|
||||
className="p-3 rounded-xl bg-brand-bg/40 border border-white/5 hover:bg-brand-bg/60 transition-colors"
|
||||
className="p-4 rounded-xl bg-brand-bg/40 border border-white/5 hover:bg-brand-bg/60 transition-colors flex justify-between items-center"
|
||||
>
|
||||
<div className="flex justify-between items-start mb-1">
|
||||
<div className="text-xs text-brand-muted font-bold uppercase tracking-tight">{usp.subLabel}</div>
|
||||
<div>
|
||||
<div className="text-xs text-brand-muted font-bold uppercase tracking-tight mb-1">{usp.subLabel}</div>
|
||||
<div className="text-base font-bold text-white mb-1">{usp.label}</div>
|
||||
<div className="text-sm text-gray-400">{usp.description}</div>
|
||||
</div>
|
||||
<div className="text-sm font-bold text-white mb-1">{usp.label}</div>
|
||||
<div className="text-xs text-gray-400 leading-tight truncate">{usp.description}</div>
|
||||
<div className="text-3xl font-bold text-brand-muted ml-4">{usp.score}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="bg-brand-card rounded-3xl p-8 border border-brand-muted/10 relative overflow-hidden">
|
||||
<h3 className="text-xl font-bold mb-6 text-center text-white">추천 타겟 키워드</h3>
|
||||
<div className="flex flex-wrap justify-center gap-3 relative z-10">
|
||||
{tags.length === 0 && <span className="text-sm text-brand-muted">정보 없음</span>}
|
||||
{tags.map((keyword, idx) => (
|
||||
<KeywordBubble key={idx} text={keyword} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="max-w-7xl mx-auto px-4 md:px-8 mt-8">
|
||||
<div className="bg-brand-card rounded-3xl p-8 border border-brand-muted/10 relative overflow-hidden">
|
||||
<h3 className="text-xl font-bold mb-6 text-white">추천 타겟 키워드</h3>
|
||||
<div className="flex flex-wrap gap-3 relative z-10">
|
||||
{tags.length === 0 && <span className="text-sm text-brand-muted">정보 없음</span>}
|
||||
{tags.map((keyword, idx) => (
|
||||
<span
|
||||
key={idx}
|
||||
className="px-5 py-2.5 rounded-full bg-brand-card border border-brand-muted/30 text-white text-sm hover:border-brand-accent/50 transition-colors"
|
||||
>
|
||||
# {keyword}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user