2026-10-09 19:18:40 +00:00
|
|
|
import type { ReactNode } from "react";
|
|
|
|
|
|
2026-10-11 11:49:28 +00:00
|
|
|
import { ChevronRightIcon } from "../lib/icons";
|
|
|
|
|
|
2026-10-15 14:14:26 +00:00
|
|
|
import { FormSectionTitle } from "./form-section-title";
|
|
|
|
|
|
2026-10-11 11:49:28 +00:00
|
|
|
/** Grupo de consulta compartido por fichas y plantillas; abierto inicialmente. */
|
2026-10-09 19:18:40 +00:00
|
|
|
export function DetailSection({ title, children }: { title: string; children: ReactNode }) {
|
|
|
|
|
return (
|
2026-10-11 11:49:28 +00:00
|
|
|
<details className="@container group/detail-section" open>
|
2026-10-15 14:14:26 +00:00
|
|
|
<summary className="flex cursor-pointer list-none items-center gap-2 py-2 focus-visible:outline-2 focus-visible:outline-ring [&::-webkit-details-marker]:hidden">
|
2026-10-11 11:49:28 +00:00
|
|
|
<ChevronRightIcon
|
|
|
|
|
aria-hidden="true"
|
2026-10-15 14:14:26 +00:00
|
|
|
className="size-3 shrink-0 text-muted-foreground transition-transform group-open/detail-section:rotate-90 motion-reduce:transition-none"
|
2026-10-11 11:49:28 +00:00
|
|
|
/>
|
2026-10-15 14:14:26 +00:00
|
|
|
<FormSectionTitle as="span">{title}</FormSectionTitle>
|
2026-10-09 19:18:40 +00:00
|
|
|
</summary>
|
2026-10-11 11:49:28 +00:00
|
|
|
<div className="space-y-3 border-t border-border/60 px-5 pb-2 [&>dl>div:first-child]:pt-2.5 [&>dl>div:last-child]:pb-2.5">
|
|
|
|
|
{children}
|
|
|
|
|
</div>
|
2026-10-09 19:18:40 +00:00
|
|
|
</details>
|
|
|
|
|
);
|
|
|
|
|
}
|