'use client'; import { useId } from 'react'; import { FDI_LOWER_LEFT_TO_RIGHT, FDI_UPPER_LEFT_TO_RIGHT, getToothShapeKind } from '@/components/treatment/fdiToothMeta'; import { ToothGlyph } from '@/components/ui/treatment/ToothGlyph'; import type { FdiToothId } from '@/types/treatment'; function quadrantMirrored(fdi: FdiToothId): boolean { const q = fdi[0]; return q === '2' || q === '3'; } interface FdiToothChartProps { selected: ReadonlySet; onToggle: (fdi: FdiToothId) => void; disabled?: boolean; } export function FdiToothChart({ selected, onToggle, disabled }: FdiToothChartProps) { const uid = useId().replace(/:/g, ''); const Row = ({ teeth }: { teeth: FdiToothId[] }) => (
{teeth.map((fdi, i) => { const kind = getToothShapeKind(fdi); const gid = `${uid}-g-${fdi}-${i}`; const isSel = selected.has(fdi); return (
{fdi}
); })}
); return (

FDI tooth chart

Tap teeth to multi-select (FDI). Selection applies to the active treatment record until you save.

Selected: {selected.size === 0 ? '—' : [...selected].sort().join(', ')}

Upper arch

Lower arch

); }