import type { ReactNode } from 'react';
import { cn } from '@/lib/utils';
interface StatusPillProps {
tone?: 'success' | 'warning';
/** Renders the pill as a link. */
href?: string;
children: ReactNode;
}
/** Status label with a coloured dot ("Connected", "Unsaved changes"); components.css .wtofe-pill. */
export default function StatusPill( { tone = 'success', href, children }: StatusPillProps ) {
const className = cn( 'wtofe-pill', `wtofe-pill--${ tone }` );
const content = (
<>
{ children }
>
);
return href ? (
{ content }
) : (
{ content }
);
}