diff --git a/packages/atoms/EventTypeList/components/controls/Dialog.tsx b/packages/atoms/EventTypeList/components/controls/Dialog.tsx new file mode 100644 index 0000000000..eb60b3140e --- /dev/null +++ b/packages/atoms/EventTypeList/components/controls/Dialog.tsx @@ -0,0 +1,30 @@ +import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog"; +import type { ReactNode } from "react"; + +export function EventTypeDialog({ + open, + onOpenChange, + title, + description, + content, +}: { + open: boolean; + onOpenChange: () => void; + title: string; + description: string; + content?: ReactNode; +}) { + return ( + <> + + + + {title} + {description} + + {!!content && content} + + + + ); +} diff --git a/packages/atoms/EventTypeList/components/controls/Dropdown.tsx b/packages/atoms/EventTypeList/components/controls/Dropdown.tsx new file mode 100644 index 0000000000..22a5744f45 --- /dev/null +++ b/packages/atoms/EventTypeList/components/controls/Dropdown.tsx @@ -0,0 +1,100 @@ +import { Button } from "@/components/ui/button"; +import { + DropdownMenu, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuSeparator, +} from "@/components/ui/dropdown-menu"; +import { MoreHorizontal, Copy, Code, Trash } from "lucide-react"; + +import { EventTypeEmbedButton } from "@calcom/features/embed/EventTypeEmbed"; + +export function EventTypeDropdown({ + group, + isReadOnly, + id, + isManagedEventType, + isChildrenManagedEventType, + embedLink, + onEdit, + onDuplicate, +}: { + group: any; + isReadOnly: boolean; + isManagedEventType: boolean; + isChildrenManagedEventType: boolean; + id: any; + embedLink: string; + onEdit: (id: string) => void; + onDuplicate: (id: string) => void; +}) { + return ( + <> + + + + + + {!isReadOnly && ( + + + + )} + {!isManagedEventType && !isChildrenManagedEventType && ( + + + + )} + {!isManagedEventType && ( + + + Embed + + + )} + {(group.metadata?.readOnly === false || group.metadata.readOnly === null) && + !isChildrenManagedEventType && ( + <> + + + + + + )} + + + + ); +} diff --git a/packages/atoms/EventTypeList/components/controls/Tooltip.tsx b/packages/atoms/EventTypeList/components/controls/Tooltip.tsx new file mode 100644 index 0000000000..27bbe90ff5 --- /dev/null +++ b/packages/atoms/EventTypeList/components/controls/Tooltip.tsx @@ -0,0 +1,21 @@ +import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip"; +import type { ReactNode } from "react"; + +export function EventTypeTooltip({ + trigger, + content, +}: { + trigger: ReactNode | string; + content: ReactNode | string; +}) { + return ( + <> + + + {trigger} + {content} + + + + ); +} diff --git a/packages/atoms/EventTypeList/components/empty-screen/createFirstEventType.tsx b/packages/atoms/EventTypeList/components/empty-screen/createFirstEventType.tsx new file mode 100644 index 0000000000..b07156d51d --- /dev/null +++ b/packages/atoms/EventTypeList/components/empty-screen/createFirstEventType.tsx @@ -0,0 +1,21 @@ +import { Button } from "@/components/ui/button"; +import { EmptyScreen } from "EventTypeList/components/empty-screen"; +import { LinkIcon } from "lucide-react"; + +export function CreateFirstEventTypeView({ slug }: { slug: string }) { + return ( + <> + + Create + + } + /> + + ); +} diff --git a/packages/atoms/EventTypeList/components/empty-screen/emptyEventTypeList.tsx b/packages/atoms/EventTypeList/components/empty-screen/emptyEventTypeList.tsx new file mode 100644 index 0000000000..dc3a17b914 --- /dev/null +++ b/packages/atoms/EventTypeList/components/empty-screen/emptyEventTypeList.tsx @@ -0,0 +1,17 @@ +import { Button } from "@/components/ui/button"; +import { EmptyScreen } from "EventTypeList/components/empty-screen"; + +export function EmptyEventTypeList({ group }: { group: any }) { + return ( + <> + + Create + + } + /> + + ); +} diff --git a/packages/atoms/EventTypeList/components/empty-screen/index.tsx b/packages/atoms/EventTypeList/components/empty-screen/index.tsx new file mode 100644 index 0000000000..17ab3e80da --- /dev/null +++ b/packages/atoms/EventTypeList/components/empty-screen/index.tsx @@ -0,0 +1,66 @@ +import { Button } from "@/components/ui/button"; +import { cn } from "@/lib/utils"; +import type { LucideIcon as IconType } from "lucide-react"; +import type { ReactNode } from "react"; +import React from "react"; + +import type { SVGComponent } from "@calcom/types/SVGComponent"; + +type EmptyScreenProps = { + 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; +}; + +export function EmptyScreen({ + Icon, + avatar, + headline, + description, + buttonText, + buttonOnClick, + buttonRaw, + border = true, + dashedBorder = true, + className, +}: EmptyScreenProps & React.HTMLAttributes) { + return ( + <> +
+ {!avatar ? null : ( +
{avatar}
+ )} + {!Icon ? null : ( +
+ +
+ )} +
+

+ {headline} +

+ {!!description && ( +
+ {description} +
+ )} + {!!buttonOnClick && !!buttonText && } + {buttonRaw} +
+
+ + ); +}