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

@@ -1,9 +1,10 @@
import { Lang } from "@/constants/languages"
import { serverClient } from "@/lib/trpc/server"
import { getValueFromContactConfig } from "@/utils/contactConfig"
import styles from "./contactRow.module.css"
import { Lang } from "@/constants/languages"
import type { ContactFields } from "@/types/requests/contactConfig"
export default async function ContactRow({
@@ -16,6 +17,11 @@ export default async function ContactRow({
})
const val = getValueFromContactConfig(contact.contact_field, data)
if (!val) {
return null
}
return (
<div className={styles.container}>
<h4 className={styles.title}>{contact.display_text}</h4>