feat(sw-187): updated typings to use schema

This commit is contained in:
Pontus Dreij
2024-09-11 16:09:17 +02:00
parent b01fca97ba
commit 800f639eb8
4 changed files with 34 additions and 42 deletions

View File

@@ -1,40 +1,34 @@
import { z } from "zod"
import {
validateLinkItem,
validateLinksWithType,
validateSecondaryLinks,
} from "@/server/routers/contentstack/base/output"
import type { LanguageSwitcherData } from "@/types/requests/languageSwitcher"
export type FooterLink = {
isExternal: boolean
openInNewTab: boolean
title: string | undefined
url: string
}
export type FooterLink = z.output<typeof validateLinkItem>
export type FooterMainNavProps = {
mainLinks: FooterLink[]
}
type FooterSecondaryNavGroup = {
title: string
links: FooterLink[]
}
type FooterLinkWithType = {
href?:
| {
href: string
title: string
}
| undefined
type: string
}
type FooterSecondaryNavGroup = z.output<typeof validateSecondaryLinks>
type FooterLinkWithType = z.output<typeof validateLinksWithType>
type FooterAppDownloads = {
title: string
links: FooterLinkWithType[]
links: FooterLinkWithType
}
type FooterSocialMedia = {
links: FooterLinkWithType[]
links: FooterLinkWithType
}
export type FooterSecondaryNavProps = {
secondaryLinks: FooterSecondaryNavGroup[]
secondaryLinks: FooterSecondaryNavGroup
appDownloads: FooterAppDownloads
}