'use client'; import { cn } from '@djangocfg/ui-core/lib'; import type { ViewMode } from './types'; interface ViewTabsProps { active: ViewMode; onChange: (mode: ViewMode) => void; /** When false the Preview tab is hidden — only HTML responses get * a useful preview, everything else renders the same as Pretty. */ showPreview: boolean; } const LABELS: Record = { pretty: 'Pretty', raw: 'Raw', preview: 'Preview', }; /** Tab strip for switching between Pretty / Raw / Preview. Matches the * visual weight of the ``LanguageTabs`` in CodeSamples so the page * reads as one coherent toolbar system. */ export function ViewTabs({ active, onChange, showPreview }: ViewTabsProps) { const tabs: ViewMode[] = showPreview ? ['pretty', 'raw', 'preview'] : ['pretty', 'raw']; return (
{tabs.map((t) => ( ))}
); }