wip: refactor sections

This commit is contained in:
2025-09-24 15:14:48 -04:00
parent b2b9b2ba8f
commit 9af11d00cf
9 changed files with 56 additions and 59 deletions

View File

@@ -0,0 +1,12 @@
import type { TheSectionFragment } from "#graphql-operations";
import SectionTextBlock from "~/components/sections/SectionTextBlock.vue";
const sections = {
GroupAbstractBuilderSectionsTextBlockLayout: SectionTextBlock,
} as const;
export function useSection({ fieldGroupName, ...attrs }: TheSectionFragment) {
const component = sections[fieldGroupName as keyof typeof sections];
if (!component) throw createError({ statusCode: 500, statusMessage: "Erreur interne", message: "Type de section invalide." });
return { component, attrs };
}