♻️ refactor: auto format

This commit is contained in:
2026-07-01 04:37:13 +07:00
parent 2fda2a2732
commit 93b079b3d3
@@ -20,16 +20,11 @@ export function CollapsibleCard({
}) { }) {
const local = useState(defaultOpen); const local = useState(defaultOpen);
const persisted = useCollapsed(persistKey ?? "", defaultOpen); const persisted = useCollapsed(persistKey ?? "", defaultOpen);
const [open, toggle] = persistKey const [open, toggle] = persistKey ? persisted : [local[0], () => local[1]((v) => !v)];
? persisted
: [local[0], () => local[1]((v) => !v)];
return ( return (
<section className="rounded-xl border border-border bg-surface-2 p-5 shadow-sm"> <section className="rounded-xl border border-border bg-surface-2 p-5 shadow-sm">
<div className={`flex items-center gap-1.5 ${open ? "mb-3" : ""}`}> <div className={`flex items-center gap-1.5 ${open ? "mb-3" : ""}`}>
<button <button onClick={toggle} className={`flex flex-1 items-center gap-1.5 ${LABEL_HEADING}`}>
onClick={toggle}
className={`flex flex-1 items-center gap-1.5 ${LABEL_HEADING}`}
>
<span className="text-faint"> <span className="text-faint">
{open ? <ChevronDown size={14} /> : <ChevronRight size={14} />} {open ? <ChevronDown size={14} /> : <ChevronRight size={14} />}
</span> </span>