generated from pascalmartineau/wp-skeleton
refactor: sections-map
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 1m6s
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 1m6s
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
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: ${fieldGroupName}` });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user