Files
o2o-clinicad-frontend/src/features/plan/ui/branding/BrandingGuidePanel.tsx
T

46 lines
1.8 KiB
TypeScript

import { useState } from "react";
import { BrandConsistencyMap } from "@/components/brand/BrandConsistencyMap";
import { SegmentTabButton } from "@/features/plan/ui/SegmentTabButton";
import type { BrandGuide } from "@/features/plan/types/marketingPlan";
import { BRANDING_GUIDE_TAB_ITEMS, type BrandingGuideTabKey } from "@/features/plan/ui/branding/brandingTabs";
import { BrandingChannelRulesTab } from "@/features/plan/ui/branding/BrandingChannelRulesTab";
import { BrandingToneVoiceTab } from "@/features/plan/ui/branding/BrandingToneVoiceTab";
import { BrandingVisualIdentityTab } from "@/features/plan/ui/branding/BrandingVisualIdentityTab";
type BrandingGuidePanelProps = {
data: BrandGuide;
};
export function BrandingGuidePanel({ data }: BrandingGuidePanelProps) {
const [activeTab, setActiveTab] = useState<BrandingGuideTabKey>("visual");
return (
<div>
<div className="flex flex-wrap gap-2 mb-8" role="tablist" aria-label="브랜딩 가이드 탭">
{BRANDING_GUIDE_TAB_ITEMS.map((tab) => {
const isActive = activeTab === tab.key;
return (
<SegmentTabButton
key={tab.key}
role="tab"
aria-selected={isActive}
title={tab.labelKr}
active={isActive}
onClick={() => setActiveTab(tab.key)}
>
{tab.label}
</SegmentTabButton>
);
})}
</div>
{activeTab === "visual" ? <BrandingVisualIdentityTab data={data} /> : null}
{activeTab === "tone" ? <BrandingToneVoiceTab tone={data.toneOfVoice} /> : null}
{activeTab === "channels" ? <BrandingChannelRulesTab channels={data.channelBranding} /> : null}
{activeTab === "consistency" ? (
<BrandConsistencyMap inconsistencies={data.brandInconsistencies} showHeading={false} />
) : null}
</div>
);
}