update list vview
parent
0cbac3b01d
commit
7329531839
|
@ -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 { Clock } from "@calcom/ui/components/icon";
|
||||||
|
|
||||||
import { EmptyScreen } from "./EmptyScreen";
|
import { EmptyScreen } from "./EmptyScreen";
|
||||||
import type { Schedule } from ".prisma/client";
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
{schedules.length === 0 ? (
|
{schedules.length === 0 ? (
|
||||||
<div>
|
<div className="flex justify-center">
|
||||||
<EmptyScreen
|
<EmptyScreen
|
||||||
Icon={Clock}
|
Icon={Clock}
|
||||||
headline="Create an availability schedule"
|
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."
|
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"
|
className="w-full"
|
||||||
|
buttonRaw={<NewScheduleButton createMutation={onCreateMutation} />}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
|
Loading…
Reference in New Issue