Files
pulsenode/components/layout/GroupSection.tsx
T

21 lines
794 B
TypeScript
Raw Normal View History

2026-08-17 13:49:55 +02:00
import type { Group } from "@/lib/config/schema";
import { widgetId } from "@/lib/config/widgets";
2026-08-17 13:49:55 +02:00
import { widgetRegistry } from "@/components/widgets/registry";
export function GroupSection({ group, groupIndex }: { group: Group; groupIndex: number }) {
2026-08-17 13:49:55 +02:00
return (
<section className="flex flex-col gap-3">
<h2 className="text-xs font-semibold tracking-wide text-fg-muted uppercase">
{group.name}
</h2>
<div className="grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-3">
{group.widgets.map((widget, index) => {
const Component = widgetRegistry[widget.type];
const id = widgetId(groupIndex, index);
return <Component key={id} widget={widget as never} widgetId={id} />;
2026-08-17 13:49:55 +02:00
})}
</div>
</section>
);
}