'use client'; /** * Shared primitive UI components used by the playground panels * (Request, Response) in both the slide-in and mobile-sheet surfaces. * Keep this file free of any business logic or context reads. */ import { ChevronRight } from 'lucide-react'; import React from 'react'; import { cn } from '@djangocfg/ui-core/lib'; // ─── Style helpers ──────────────────────────────────────────────────────────── // Method/status → semantic status-token mappings live in ./http-colors and are // re-exported here so existing imports of `./ui` keep working. export { getMethodStyle, getStatusStyle } from './http-colors'; import { getMethodStyle, getStatusStyle } from './http-colors'; // ``relativePath`` lives in utils/url.ts now — re-exported here so every // component that used to import it from ``./ui`` keeps working. export { relativePath } from '../../utils/url'; // ─── Atoms ──────────────────────────────────────────────────────────────────── export function MethodBadge({ method }: { method: string }) { return ( {method} ); } export function StatusBadge({ status }: { status: number }) { return ( {status} ); } export function SectionLabel({ children }: { children: React.ReactNode }) { return (

{children}

); } export function Panel({ children, className }: { children: React.ReactNode; className?: string }) { return (
{children}
); } export function ScrollArea({ children, className }: { children: React.ReactNode; className?: string }) { return (
{children}
); } export function PanelHeader({ title }: { title: string }) { return (
{title}
); } export function EmptyState({ icon: Icon, text, className, }: { icon: React.ElementType; text: string; className?: string; }) { return (

{text}

); } export function CollapsibleSection({ label, action, children, defaultOpen = false, }: { label: React.ReactNode; action?: React.ReactNode; children: React.ReactNode; defaultOpen?: boolean; }) { const [open, setOpen] = React.useState(defaultOpen); return (
{action &&
{action}
}
{open &&
{children}
}
); }