'use client'; /** * `` — the styled chip a resolved slash verb renders as * once the machine reaches `command` state. Intended for `blockStart` * or `inlineStart` composer slots so the editor reads `[/clear] args` * — the verb is a token, the rest is free-text argument. */ import { cn } from '@djangocfg/ui-core/lib'; import type { SlashCommand } from './types'; export interface SlashTokenProps { command: SlashCommand; /** Called to clear the verb (drop it back to plain text). */ onClear?: () => void; /** Optional close-icon node. Default: a small `×` glyph. */ clearIcon?: React.ReactNode; className?: string; } export function SlashToken({ command, onClear, clearIcon, className, }: SlashTokenProps) { return ( {command.icon ? ( {command.icon} ) : null} {command.token} {onClear ? ( ) : null} ); }