2026-08-17 13:49:55 +02:00
|
|
|
import type { Group } from "@/lib/config/schema";
|
2026-08-17 14:01:53 +02:00
|
|
|
import { widgetId } from "@/lib/config/widgets";
|
2026-08-17 13:49:55 +02:00
|
|
|
import { widgetRegistry } from "@/components/widgets/registry";
|
|
|
|
|
|
2026-08-17 14:01:53 +02:00
|
|
|
export function GroupSection({ group, groupIndex }: { group: Group; groupIndex: number }) {
|
2026-08-17 13:49:55 +02:00
|
|
|
return (
|
2026-08-17 17:21:18 +02:00
|
|
|
<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];
|
2026-08-17 14:01:53 +02:00
|
|
|
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>
|
|
|
|
|
);
|
|
|
|
|
}
|