refactor: shared useSection
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 59s

This commit is contained in:
2025-09-24 15:16:20 -04:00
parent 9af11d00cf
commit 5f2c464c9a
2 changed files with 0 additions and 12 deletions

View File

@@ -1,12 +0,0 @@
import type { TheSectionFragment } from "#graphql-operations";
import { SectionTextBlock } from "#components";
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 };
}