refactor(ui): organize component source tree

This commit is contained in:
vince 2026-06-20 06:43:09 +02:00
parent 8927f2ab8a
commit 32ad2cebe4
66 changed files with 194 additions and 124 deletions

View file

@ -1,32 +0,0 @@
import { useId } from "react";
import type { UiModuleBlock } from "../types";
import { IconGlyph } from "./IconGlyph";
export interface ModuleCardProps {
module: UiModuleBlock;
}
export function ModuleCard({ module }: ModuleCardProps) {
const generatedId = useId();
const titleId = `${generatedId}-title`;
const ariaLabel = module.title ? undefined : module.label || module.id;
return (
<aside
className="module-card"
data-severity={module.severity || "neutral"}
data-model-id={module.id}
aria-labelledby={module.title ? titleId : undefined}
aria-label={ariaLabel}
>
<div>
{module.title ? <h2 id={titleId}>{module.title}</h2> : null}
{module.value ? <strong>{module.value}</strong> : null}
{module.detail || module.label ? (
<p>{module.detail || module.label}</p>
) : null}
</div>
{module.icon ? <IconGlyph name={module.icon} size="lg" /> : null}
</aside>
);
}