'use client'; import { CopyButton } from '@djangocfg/ui-core/components'; import type { ApiResponse } from '../../../types'; import { StatusBadge } from '../ui'; interface StatusBarProps { response: ApiResponse; rawText: string; /** Content-Type label shown inline next to size/duration. ``null`` * when the server didn't send one — we hide the slot instead of * showing an empty dash. */ contentType: string | null; } /** Top strip of the response panel: status badge, statusText, size, * duration, content-type, copy button. Compact — one line, tabular * numerals so 1.4 KB and 107ms don't shift as values update. */ export function StatusBar({ response, rawText, contentType }: StatusBarProps) { const sizeKb = rawText ? `${(rawText.length / 1024).toFixed(1)} KB` : ''; const duration = response.duration != null ? `${response.duration}ms` : ''; const hasStatus = response.status != null; const hasCopy = Boolean(rawText); return (