feat: Initial TheSections

This commit is contained in:
2025-09-22 11:49:48 -04:00
parent c6fce32c54
commit fe2b500684
10 changed files with 78 additions and 28 deletions

View File

@@ -0,0 +1,12 @@
import type { SectionTextBlockFragment, TheSectionFragment } from "#graphql-operations";
import { SectionTextBlock } from "#components";
export function useSection(section: TheSectionFragment) {
const { fieldGroupName, ...attrs } = section;
switch (fieldGroupName) {
case "GroupAbstractBuilderSectionsTextBlockLayout":
return { component: SectionTextBlock, attrs: attrs as SectionTextBlockFragment };
default:
throw createError({ statusCode: 500, statusMessage: "Erreur interne", message: "Type de section invalide" });
}
}