From de218e96bbd32b39f265cd98577fc74f414c4908 Mon Sep 17 00:00:00 2001 From: Ryukemeister Date: Mon, 9 Oct 2023 21:31:03 +0530 Subject: [PATCH] init availabilitylist component --- .../availabilitylist/AvailabilityList.tsx | 15 +++++ .../atoms/availabilitylist/EmptyScreen.tsx | 66 +++++++++++++++++++ packages/atoms/availabilitylist/export.ts | 2 + 3 files changed, 83 insertions(+) create mode 100644 packages/atoms/availabilitylist/AvailabilityList.tsx create mode 100644 packages/atoms/availabilitylist/EmptyScreen.tsx create mode 100644 packages/atoms/availabilitylist/export.ts diff --git a/packages/atoms/availabilitylist/AvailabilityList.tsx b/packages/atoms/availabilitylist/AvailabilityList.tsx new file mode 100644 index 0000000000..302ba67d8b --- /dev/null +++ b/packages/atoms/availabilitylist/AvailabilityList.tsx @@ -0,0 +1,15 @@ +import { EmptyScreen } from " ./EmptyScreen"; + +export function AvailabilityList({ schedules }: []) { + return ( + <> + {schedules.length === 0 ? ( +
+ +
+ ) : ( +
Render availability list here
+ )} + + ); +} diff --git a/packages/atoms/availabilitylist/EmptyScreen.tsx b/packages/atoms/availabilitylist/EmptyScreen.tsx new file mode 100644 index 0000000000..16964678b9 --- /dev/null +++ b/packages/atoms/availabilitylist/EmptyScreen.tsx @@ -0,0 +1,66 @@ +import type { LucideIcon as IconType } from "lucide-react"; +import type { ReactNode } from "react"; +import React from "react"; + +import { classNames } from "@calcom/lib"; +import type { SVGComponent } from "@calcom/types/SVGComponent"; + +export function EmptyScreen({ + Icon, + avatar, + headline, + description, + buttonText, + buttonOnClick, + buttonRaw, + border = true, + dashedBorder = true, + className, +}: { + Icon?: SVGComponent | IconType; + avatar?: React.ReactElement; + headline: string | React.ReactElement; + description?: string | React.ReactElement; + buttonText?: string; + buttonOnClick?: (event: React.MouseEvent) => void; + buttonRaw?: ReactNode; // Used incase you want to provide your own button. + border?: boolean; + dashedBorder?: boolean; +}) { + return ( + <> +
+ {!avatar ? null : ( +
{avatar}
+ )} + {!Icon ? null : ( +
+ +
+ )} +
+

+ {headline} +

+ {description && ( +
+ {description} +
+ )} + {buttonRaw} +
+
+ + ); +} diff --git a/packages/atoms/availabilitylist/export.ts b/packages/atoms/availabilitylist/export.ts new file mode 100644 index 0000000000..a5fc4c913c --- /dev/null +++ b/packages/atoms/availabilitylist/export.ts @@ -0,0 +1,2 @@ +export { AvailabilityList } from "./AvailabilityList"; +export * from "../types";