refactor: infer types from zod validation

This commit is contained in:
Christel Westerberg
2024-04-29 09:53:54 +02:00
parent 00f30811cf
commit 49b7aa89f8
18 changed files with 418 additions and 217 deletions

View File

@@ -35,16 +35,9 @@ export default function CardGrid({ card_grid }: CardGridProps) {
}
function CardWrapper({ card }: CardProps) {
const link = card.referenceConnection.edges.length
? {
href: card.referenceConnection.edges[0].node.url,
title: _("Read more"),
}
: undefined
return (
<div className={styles.cardWrapper}>
<Card subtitle={card.subtitle} title={card.title} link={link} />
<Card subtitle={card.subtitle} title={card.title} link={card.link} />
</div>
)
}