refactor: infer types from zod validation
This commit is contained in:
@@ -2,15 +2,16 @@ import JsonToHtml from "@/components/JsonToHtml"
|
||||
|
||||
import JoinLoyaltyContact from "./JoinLoyalty"
|
||||
|
||||
import { Sidebar, SidebarTypenameEnum } from "@/types/requests/loyaltyPage"
|
||||
import { SidebarProps } from "@/types/components/loyalty/sidebar"
|
||||
import { SidebarTypenameEnum } from "@/types/requests/loyaltyPage"
|
||||
|
||||
export default function SidebarLoyalty({ block }: { block: Sidebar }) {
|
||||
export default function SidebarLoyalty({ block }: SidebarProps) {
|
||||
switch (block.__typename) {
|
||||
case SidebarTypenameEnum.LoyaltyPageSidebarContent:
|
||||
return (
|
||||
<JsonToHtml
|
||||
embeds={block.content.embedded_itemsConnection.edges}
|
||||
nodes={block.content.json.children}
|
||||
embeds={block.content.content.embedded_itemsConnection.edges}
|
||||
nodes={block.content.content.json.children}
|
||||
/>
|
||||
)
|
||||
case SidebarTypenameEnum.LoyaltyPageSidebarJoinLoyaltyContact:
|
||||
|
||||
Reference in New Issue
Block a user