diff --git a/packages/features/users/components/UserTable/EditSheet/DisplayInfo.tsx b/packages/features/users/components/UserTable/EditSheet/DisplayInfo.tsx index 2f8f05b7a0..8745cf5844 100644 --- a/packages/features/users/components/UserTable/EditSheet/DisplayInfo.tsx +++ b/packages/features/users/components/UserTable/EditSheet/DisplayInfo.tsx @@ -1,6 +1,9 @@ -import type { IconName } from "@calcom/ui/components/icon"; +import { useRef, useState } from "react"; + import { Badge } from "@calcom/ui/components/badge"; +import type { IconName } from "@calcom/ui/components/icon"; import { Icon } from "@calcom/ui/components/icon"; +import { Tooltip } from "@calcom/ui/components/tooltip"; type DisplayInfoType = { label: string; @@ -24,6 +27,19 @@ export function DisplayInfo({ valueClassname = valueDefaultClassname, }: DisplayInfoType) { const displayAsBadges = Array.isArray(value); + const scrollContainerRef = useRef(null); + const [showLeftGradient, setShowLeftGradient] = useState(false); + const [showRightGradient, setShowRightGradient] = useState(true); + + const handleScroll = () => { + const element = scrollContainerRef.current; + if (!element) return; + + setShowLeftGradient(element.scrollLeft > 0); + + const isAtEnd = Math.abs(element.scrollWidth - element.clientWidth - element.scrollLeft) < 1; + setShowRightGradient(!isAtEnd); + }; return (
@@ -40,12 +56,31 @@ export function DisplayInfo({ {v} ) : ( - {v} + + {v} + ); })}
) : ( - {value} +
+
+ +
+ {value} +
+
+ {showLeftGradient && ( +
+ )} + {showRightGradient && ( +
+ )} +
+
)}