import { useWidgetStore } from "../../../store/useWidgetStore"; import ProgressCard from "../realTimeVis/charts/ProgressCard"; import PieGraphComponent from "../realTimeVis/charts/PieGraphComponent"; import BarGraphComponent from "../realTimeVis/charts/BarGraphComponent"; import LineGraphComponent from "../realTimeVis/charts/LineGraphComponent"; import RadarGraphComponent from "../realTimeVis/charts/RadarGraphComponent"; import DoughnutGraphComponent from "../realTimeVis/charts/DoughnutGraphComponent"; import PolarAreaGraphComponent from "../realTimeVis/charts/PolarAreaGraphComponent"; export const DraggableWidget = ({ widget, hiddenPanels, // Add this prop to track hidden panels }: { widget: any; hiddenPanels: string[]; // Array of hidden panel names }) => { console.log("widget: ", widget.type); const { selectedChartId, setSelectedChartId } = useWidgetStore(); const handlePointerDown = () => { if (selectedChartId?.id !== widget.id) { setSelectedChartId(widget); } }; // Determine if the widget's panel is hidden const isPanelHidden = hiddenPanels.includes(widget.panel); return ( <>