SW-65 Moved type to /types
This commit is contained in:
@@ -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: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
5
types/components/bookingWidget/index.ts
Normal file
5
types/components/bookingWidget/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { bookingWidgetSchema } from "@/components/BookingWidget/schema"
|
||||
|
||||
export type BookingWidgetSchema = z.infer<typeof bookingWidgetSchema>
|
||||
Reference in New Issue
Block a user