Files

24 lines
864 B
TypeScript
Raw Permalink 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="mt-8 flex flex-col gap-4">
<div className="flex items-baseline gap-2.5">
<h6 className="m-0 text-xs font-semibold tracking-wide text-fg-muted uppercase">
{group.name}
</h6>
<div className="pn-hr" />
</div>
<div className="pn-bento gap-4">
2026-08-17 13:49:55 +02:00
{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>
);
}