import { useContext, useRef, useState } from "react"; import TextCustomization from "../EachComponent/Customization/TextCustomization"; import LockObject from "../EachComponent/Customization/LockObject"; import OpacityCustomization from "../EachComponent/Customization/OpacityCustomization"; import CanvasContext from "../Context/canvasContext/CanvasContext"; import { ObjectShortcut } from "../ObjectShortcut"; import ActiveObjectContext from "../Context/activeObject/ObjectContext"; import { Button } from "../ui/button"; import { ImagePlus, ChevronLeft, ChevronRight } from "lucide-react"; import { RxBorderWidth } from "react-icons/rx"; import { LuFlipVertical } from "react-icons/lu"; import { SlTarget } from "react-icons/sl"; import { RiShadowLine } from "react-icons/ri"; import { FaRegObjectGroup } from "react-icons/fa"; import { Tooltip } from "react-tooltip"; export function TopBar() { const { activeObject } = useContext(ActiveObjectContext); const { selectedPanel, setSelectedPanel, textColor } = useContext(CanvasContext); const activeObjectType = activeObject?.type; const hasClipPath = !!activeObject?.clipPath; const customClipPath = activeObject?.isClipPath; const scrollContainerRef = useRef(null); const [showScrollButtons, setShowScrollButtons] = useState(false); const scroll = (direction) => { const container = scrollContainerRef.current; if (container) { const scrollAmount = 200; // Adjust this value to change scroll distance container.scrollBy({ left: direction * scrollAmount, behavior: "smooth", }); } }; return (