update list vview

availability-list
Ryukemeister 2023-10-12 18:20:10 +05:30
parent 0cbac3b01d
commit 7329531839
1 changed files with 15 additions and 2 deletions

View File

@ -1,18 +1,31 @@
import { NewScheduleButton } from "availabilitylist/NewScheduleButton";
import type { HttpError } from "@calcom/lib/http-error";
import { Clock } from "@calcom/ui/components/icon";
import { EmptyScreen } from "./EmptyScreen";
import type { Schedule } from ".prisma/client";
export function AvailabilityList({ schedules }: { schedules: Schedule[] | [] }) {
export function AvailabilityList({
schedules,
onCreateMutation,
}: {
schedules: Schedule[] | [];
onCreateMutation: (values: {
onSucess: (schedule: Schedule) => void;
onError: (err: HttpError) => void;
}) => void;
}) {
return (
<>
{schedules.length === 0 ? (
<div>
<div className="flex justify-center">
<EmptyScreen
Icon={Clock}
headline="Create an availability schedule"
subtitle="Creating availability schedules allows you to manage availability across event types. They can be applied to one or more event types."
className="w-full"
buttonRaw={<NewScheduleButton createMutation={onCreateMutation} />}
/>
</div>
) : (