22 lines
553 B
TypeScript
22 lines
553 B
TypeScript
import { cn } from '@/lib/utils'
|
|
import { debugProps } from '@/lib/debug'
|
|
|
|
interface CodeBadgeProps {
|
|
code: string | null | undefined
|
|
className?: string
|
|
}
|
|
|
|
export function CodeBadge({ code, className }: CodeBadgeProps) {
|
|
if (!code) return null
|
|
return (
|
|
<span
|
|
{...debugProps('code-badge')}
|
|
className={cn(
|
|
'inline-flex items-center rounded-md border border-border bg-surface-container px-1.5 py-0.5 font-mono text-[11px] leading-none text-muted-foreground',
|
|
className,
|
|
)}
|
|
>
|
|
{code}
|
|
</span>
|
|
)
|
|
}
|