SW-65 Moved type to /types

This commit is contained in:
Hrishikesh Vaipurkar
2024-08-01 16:11:05 +02:00
parent 23c97db987
commit 1dfcd144fb
4 changed files with 19 additions and 8 deletions

View File

@@ -5,10 +5,12 @@ import { FormProvider, useForm } from "react-hook-form"
import { dt } from "@/lib/dt"
import Button from "../TempDesignSystem/Button"
import { type BookingWidgetSchema, bookingWidgetSchema } from "./schema"
import { bookingWidgetSchema } from "./schema"
import styles from "./bookingWidget.module.css"
import { type BookingWidgetSchema } from "@/types/components/bookingWidget"
export function BookingWidget() {
const methods = useForm<BookingWidgetSchema>({
defaultValues: {
@@ -27,8 +29,8 @@ export function BookingWidget() {
voucher: false,
rooms: [
{
Adults: 1,
Child: 0,
adults: 1,
childs: [],
},
],
},

View File

@@ -14,11 +14,15 @@ export const bookingWidgetSchema = z.object({
redemption: z.boolean().default(false),
voucher: z.boolean().default(false),
rooms: z.array(
// This will be updated when working in guests component
z.object({
Adults: z.number().default(1),
Child: z.number().default(0),
adults: z.number().default(1),
childs: z.array(
z.object({
age: z.number(),
bed: z.number(),
})
),
})
),
})
export type BookingWidgetSchema = z.infer<typeof bookingWidgetSchema>

View File

@@ -3,8 +3,8 @@ import { env } from "@/env/server"
import { serverClient } from "@/lib/trpc/server"
import { auth } from "@/auth"
import { BookingWidget } from "@/components/BookingWidget"
import { BookingWidget } from "../../BookingWidget"
import { MainMenu } from "./MainMenu"
import OfflineBanner from "./OfflineBanner"
import TopMenu from "./TopMenu"

View File

@@ -0,0 +1,5 @@
import { z } from "zod"
import { bookingWidgetSchema } from "@/components/BookingWidget/schema"
export type BookingWidgetSchema = z.infer<typeof bookingWidgetSchema>