feat: P0 fixes — date formatting, channel labels, dynamic marketing plan
- ReportHeader/PlanHeader: format ISO dates as Korean (2026년 4월 2일) - ChannelOverview: map API keys to Korean labels (naverBlog → 네이버 블로그) - useMarketingPlan: replace mockPlan with real DB-based plan generation - transformPlan: build MarketingPlan from report data (channels, pillars, calendar) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
bd7bc45192
commit
4484ac788a
5 files changed
+302
-12
No files matched your search
@@ -1,6 +1,18 @@
|
||||
import { motion } from 'motion/react';
|
||||
import { Calendar, Globe } from 'lucide-react';
|
||||
|
||||
function formatDate(raw: string): string {
|
||||
try {
|
||||
return new Date(raw).toLocaleDateString('ko-KR', {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
});
|
||||
} catch {
|
||||
return raw;
|
||||
}
|
||||
}
|
||||
|
||||
interface PlanHeaderProps {
|
||||
clinicName: string;
|
||||
clinicNameEn: string;
|
||||
@@ -82,7 +94,7 @@ export default function PlanHeader({
|
||||
>
|
||||
<span className="inline-flex items-center gap-2 rounded-full bg-white/60 backdrop-blur-sm border border-white/40 px-3 py-1 text-sm font-medium text-slate-700">
|
||||
<Calendar size={14} className="text-slate-400" />
|
||||
{date}
|
||||
{formatDate(date)}
|
||||
</span>
|
||||
<span className="inline-flex items-center gap-2 rounded-full bg-white/60 backdrop-blur-sm border border-white/40 px-3 py-1 text-sm font-medium text-slate-700">
|
||||
<Globe size={14} className="text-slate-400" />
|
||||
|
||||
@@ -19,6 +19,18 @@ const iconMap: Record<string, ComponentType<{ size?: number; className?: string
|
||||
search: Search,
|
||||
};
|
||||
|
||||
const channelLabel: Record<string, string> = {
|
||||
naverBlog: '네이버 블로그',
|
||||
naverPlace: '네이버 플레이스',
|
||||
gangnamUnni: '강남언니',
|
||||
instagram: 'Instagram',
|
||||
youtube: 'YouTube',
|
||||
facebook: 'Facebook',
|
||||
website: '웹사이트',
|
||||
tiktok: 'TikTok',
|
||||
blog: '블로그',
|
||||
};
|
||||
|
||||
const brandColor: Record<string, string> = {
|
||||
facebook: '#1877F2',
|
||||
instagram: '#E1306C',
|
||||
@@ -49,7 +61,7 @@ export default function ChannelOverview({ channels }: ChannelOverviewProps) {
|
||||
<div className="w-10 h-10 rounded-xl bg-slate-50 flex items-center justify-center">
|
||||
<Icon size={20} style={color ? { color } : undefined} className={color ? '' : 'text-slate-500'} />
|
||||
</div>
|
||||
<p className="text-sm font-medium text-[#0A1128]">{ch.channel}</p>
|
||||
<p className="text-sm font-medium text-[#0A1128]">{channelLabel[ch.channel] || ch.channel}</p>
|
||||
<ScoreRing score={ch.score} maxScore={ch.maxScore} size={60} color={color} />
|
||||
<p className="text-xs text-slate-500 line-clamp-2 leading-relaxed">
|
||||
{ch.headline}
|
||||
|
||||
@@ -2,6 +2,18 @@ import { motion } from 'motion/react';
|
||||
import { Calendar, Globe, MapPin } from 'lucide-react';
|
||||
import { ScoreRing } from './ui/ScoreRing';
|
||||
|
||||
function formatDate(raw: string): string {
|
||||
try {
|
||||
return new Date(raw).toLocaleDateString('ko-KR', {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
});
|
||||
} catch {
|
||||
return raw;
|
||||
}
|
||||
}
|
||||
|
||||
interface ReportHeaderProps {
|
||||
clinicName: string;
|
||||
clinicNameEn: string;
|
||||
@@ -108,7 +120,7 @@ export default function ReportHeader({
|
||||
>
|
||||
<span className="inline-flex items-center gap-2 rounded-full bg-white/60 backdrop-blur-sm border border-white/40 px-3 py-1 text-sm font-medium text-slate-700">
|
||||
<Calendar size={14} className="text-slate-400" />
|
||||
{date}
|
||||
{formatDate(date)}
|
||||
</span>
|
||||
<span className="inline-flex items-center gap-2 rounded-full bg-white/60 backdrop-blur-sm border border-white/40 px-3 py-1 text-sm font-medium text-slate-700">
|
||||
<Globe size={14} className="text-slate-400" />
|
||||
|
||||
Reference in new issue
Block a user