diff --git a/packages/features/users/components/UserTable/EditSheet/DisplayInfo.tsx b/packages/features/users/components/UserTable/EditSheet/DisplayInfo.tsx index 075699ec33..4f52ba690b 100644 --- a/packages/features/users/components/UserTable/EditSheet/DisplayInfo.tsx +++ b/packages/features/users/components/UserTable/EditSheet/DisplayInfo.tsx @@ -1,68 +1,43 @@ import { classNames } from "@calcom/lib"; -import { useCopy } from "@calcom/lib/hooks/useCopy"; -import type { BadgeProps } from "@calcom/ui"; -import { Badge, Button, Label } from "@calcom/ui"; +import type { IconName } from "@calcom/ui"; +import { Badge, Icon } from "@calcom/ui"; -type DisplayInfoType = { +type DisplayInfoType = { label: string; - value: T extends true ? string[] : string; - asBadge?: boolean; - isArray?: T; - displayCopy?: boolean; - badgeColor?: BadgeProps["variant"]; -} & (T extends false - ? { displayCopy?: boolean; displayCount?: never } - : { displayCopy?: never; displayCount?: number }); // Only show displayCopy if its not an array is false + icon?: IconName; + value: string | string[]; + coloredBadges?: boolean; +}; -export function DisplayInfo({ - label, - value, - asBadge, - isArray, - displayCopy, - displayCount, - badgeColor, -}: DisplayInfoType) { - const { copyToClipboard, isCopied } = useCopy(); - const values = (isArray ? value : [value]) as string[]; +const badgeColors = ["warning", "success", "green", "gray", "blue", "red", "error"] as const; + +export function DisplayInfo({ label, icon, value, coloredBadges }: DisplayInfoType) { + const displayAsBadges = Array.isArray(value); return ( -
- -
- <> - {values.map((v) => { - const content = ( - - {v} - {displayCopy && ( - - @@ -34,7 +33,7 @@ function MoreInfoFooter() { return ( <> - @@ -43,8 +42,6 @@ function MoreInfoFooter() { onClick={() => { setEditMode(true); }} - className="w-full justify-center gap-2" - variant="icon" key="EDIT_BUTTON" StartIcon="pencil"> {t("edit")} diff --git a/packages/ui/components/badge/Badge.tsx b/packages/ui/components/badge/Badge.tsx index c0d268f099..35c76e326e 100644 --- a/packages/ui/components/badge/Badge.tsx +++ b/packages/ui/components/badge/Badge.tsx @@ -14,7 +14,7 @@ export const badgeStyles = cva("font-medium inline-flex items-center justify-cen orange: "bg-attention text-attention", success: "bg-success text-success", green: "bg-success text-success", - gray: "bg-subtle text-emphasis", + gray: "bg-emphasis text-emphasis", blue: "bg-info text-info", red: "bg-error text-error", error: "bg-error text-error", diff --git a/packages/ui/components/sheet/sheet.tsx b/packages/ui/components/sheet/sheet.tsx index e5cdcfd11a..c5a2d16847 100644 --- a/packages/ui/components/sheet/sheet.tsx +++ b/packages/ui/components/sheet/sheet.tsx @@ -68,7 +68,7 @@ const SheetContent = React.forwardRef< ref={forwardedRef} className={classNames( // base - "fixed inset-y-2 mx-auto flex w-[95vw] flex-1 flex-col overflow-y-auto rounded-md border p-4 shadow-lg focus:outline-none max-sm:inset-x-2 sm:inset-y-2 sm:right-2 sm:max-w-lg sm:p-6", + "fixed inset-y-2 mx-auto flex w-[95vw] flex-1 flex-col overflow-y-auto rounded-xl border p-4 shadow-lg focus:outline-none max-sm:inset-x-2 sm:inset-y-2 sm:right-2 sm:max-w-lg sm:p-6", // border color "border-subtle", // background color @@ -86,21 +86,21 @@ const SheetContent = React.forwardRef< SheetContent.displayName = "SheetContent"; -const SheetHeader = React.forwardRef>( - ({ children, className, ...props }, ref) => { - return ( -
-
{children}
+const SheetHeader = React.forwardRef< + HTMLDivElement, + React.ComponentPropsWithoutRef<"div"> & { showCloseButton?: boolean } +>(({ children, className, showCloseButton = true, ...props }, ref) => { + return ( +
+
{children}
+ {showCloseButton && (
- ); - } -); + )} +
+ ); +}); SheetHeader.displayName = "Sheet.Header";