feat(SW-190): added hero to static content pages

This commit is contained in:
Erik Tiekstra
2024-08-14 09:29:00 +02:00
parent f1ca9a0704
commit 8220a39a8f
23 changed files with 351 additions and 64 deletions
@@ -0,0 +1,30 @@
import { z } from "zod"
import { Lang } from "@/constants/languages"
import { ImageVaultAsset } from "@/types/components/imageVaultImage"
export const validateContentPageSchema = z.object({
content_page: z.object({
title: z.string(),
header: z.object({
heading: z.string(),
preamble: z.string(),
}),
hero_image: z.any().nullable(),
system: z.object({
uid: z.string(),
locale: z.nativeEnum(Lang),
created_at: z.string(),
updated_at: z.string(),
}),
}),
})
export type ContentPageDataRaw = z.infer<typeof validateContentPageSchema>
type ContentPageRaw = ContentPageDataRaw["content_page"]
export type ContentPage = Omit<ContentPageRaw, "hero_image"> & {
hero_image?: ImageVaultAsset
}