generated from pascalmartineau/wp-skeleton
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 58s
13 lines
540 B
TypeScript
13 lines
540 B
TypeScript
import type { TheSectionFragment } from "#graphql-operations";
|
|
import SectionTextBlock from "~/components/sections/SectionTextBlock.vue";
|
|
|
|
const sections = {
|
|
GroupAbstractBuilderSectionsTextBlockLayout: SectionTextBlock,
|
|
} as const;
|
|
|
|
export function useSection({ __typename, ...attrs }: TheSectionFragment) {
|
|
const component = sections[__typename as keyof typeof sections];
|
|
if (!component) throw createError({ statusCode: 500, statusMessage: "Erreur interne", message: "Type de section invalide." });
|
|
return { component, attrs };
|
|
}
|