feature: treatment frontend wired with the newly implemented backend. no mocked data no more.
This commit is contained in:
@@ -103,7 +103,7 @@ export function FdiToothChart({ selected, onToggle, disabled }: FdiToothChartPro
|
||||
};
|
||||
|
||||
const Row = ({ teeth, upper }: { teeth: FdiToothId[]; upper?: boolean }) => (
|
||||
<div className="flex flex-wrap justify-center gap-x-1 gap-y-1">
|
||||
<div className="flex flex-nowrap justify-center gap-x-1 min-w-max mx-auto w-fit">
|
||||
{teeth.map((fdi, i) => {
|
||||
const kind = getToothShapeKind(fdi);
|
||||
const gid = `${uid}-g-${fdi}-${i}`;
|
||||
@@ -148,61 +148,36 @@ export function FdiToothChart({ selected, onToggle, disabled }: FdiToothChartPro
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="surface-card p-4 space-y-6">
|
||||
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
|
||||
<div className="surface-card p-3 space-y-3">
|
||||
<div className="flex flex-col gap-1.5 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<h3 className="text-sm font-semibold text-text-primary">FDI tooth chart</h3>
|
||||
<p className="text-xs text-text-muted mt-0.5">
|
||||
Tap teeth to multi-select (FDI). Selection applies to the active treatment case until you save.
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex flex-col gap-2 sm:items-end w-full sm:max-w-xs">
|
||||
<p className="text-xs text-text-secondary tabular-nums text-right">
|
||||
Selected: {selected.size === 0 ? '—' : [...selected].sort().join(', ')}
|
||||
<p className="text-[11px] text-text-muted mt-0.5">
|
||||
Tap teeth to multi-select. Applies to the active case.
|
||||
</p>
|
||||
</div>
|
||||
<p className="text-[11px] text-text-secondary tabular-nums sm:text-right">
|
||||
Selected: {selected.size === 0 ? '—' : [...selected].sort().join(', ')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p className="text-[11px] uppercase tracking-wide text-text-muted mb-1 text-center">Upper arch</p>
|
||||
|
||||
<div className="relative isolate py-1">
|
||||
<div
|
||||
className="pointer-events-none absolute left-1/2 top-3 bottom-3 w-px -translate-x-1/2 bg-border/70"
|
||||
aria-hidden
|
||||
/>
|
||||
<div className="relative z-10 space-y-0">
|
||||
<Row teeth={FDI_UPPER_LEFT_TO_RIGHT} upper />
|
||||
<div className={`flex justify-center gap-x-1 ${TOOTH_NUMBER_GAP}`}>
|
||||
{FDI_UPPER_LEFT_TO_RIGHT.map((fdi) => {
|
||||
const size = toothSizeClass(fdi);
|
||||
const isSel = selected.has(fdi);
|
||||
return (
|
||||
<span
|
||||
key={`u-${fdi}`}
|
||||
className={`text-[10px] tabular-nums text-center leading-none ${size.wrapper} ${
|
||||
isSel ? 'text-primary' : 'text-text-muted'
|
||||
}`}
|
||||
>
|
||||
{fdi}
|
||||
</span>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
<div className="overflow-x-auto py-1 -mx-1 px-1">
|
||||
<div className="relative isolate min-w-max mx-auto w-fit">
|
||||
<div
|
||||
className="my-4 h-px w-full max-w-[min(100%,42rem)] mx-auto bg-border/70"
|
||||
role="separator"
|
||||
className="pointer-events-none absolute left-1/2 top-3 bottom-3 w-px -translate-x-1/2 bg-border/70"
|
||||
aria-hidden
|
||||
/>
|
||||
|
||||
<div className="my-4 pt-1">
|
||||
<div className="flex justify-center gap-x-1">
|
||||
{FDI_LOWER_LEFT_TO_RIGHT.map((fdi) => {
|
||||
<div className="relative z-10 space-y-0">
|
||||
<Row teeth={FDI_UPPER_LEFT_TO_RIGHT} upper />
|
||||
<div className={`flex flex-nowrap justify-center gap-x-1 ${TOOTH_NUMBER_GAP}`}>
|
||||
{FDI_UPPER_LEFT_TO_RIGHT.map((fdi) => {
|
||||
const size = toothSizeClass(fdi);
|
||||
const isSel = selected.has(fdi);
|
||||
return (
|
||||
<span
|
||||
key={`l-${fdi}`}
|
||||
key={`u-${fdi}`}
|
||||
className={`text-[10px] tabular-nums text-center leading-none ${size.wrapper} ${
|
||||
isSel ? 'text-primary' : 'text-text-muted'
|
||||
}`}
|
||||
@@ -212,8 +187,29 @@ export function FdiToothChart({ selected, onToggle, disabled }: FdiToothChartPro
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<div className={TOOTH_NUMBER_GAP}>
|
||||
<Row teeth={FDI_LOWER_LEFT_TO_RIGHT} />
|
||||
|
||||
<div className="my-2 h-px w-full bg-border/70" role="separator" aria-hidden />
|
||||
|
||||
<div className="pt-0.5">
|
||||
<div className="flex flex-nowrap justify-center gap-x-1">
|
||||
{FDI_LOWER_LEFT_TO_RIGHT.map((fdi) => {
|
||||
const size = toothSizeClass(fdi);
|
||||
const isSel = selected.has(fdi);
|
||||
return (
|
||||
<span
|
||||
key={`l-${fdi}`}
|
||||
className={`text-[10px] tabular-nums text-center leading-none ${size.wrapper} ${
|
||||
isSel ? 'text-primary' : 'text-text-muted'
|
||||
}`}
|
||||
>
|
||||
{fdi}
|
||||
</span>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<div className={TOOTH_NUMBER_GAP}>
|
||||
<Row teeth={FDI_LOWER_LEFT_TO_RIGHT} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user