2025-03-25 06:17:41 +00:00
|
|
|
|
import React from "react";
|
|
|
|
|
import {
|
|
|
|
|
CartIcon,
|
|
|
|
|
DocumentIcon,
|
|
|
|
|
GlobeIcon,
|
|
|
|
|
WalletIcon,
|
|
|
|
|
} from "../../../../icons/3dChartIcons";
|
2025-04-21 06:23:42 +00:00
|
|
|
|
import SimpleCard from "../../../../../modules//visualization/widgets/floating/cards/SimpleCard";
|
2025-03-25 06:17:41 +00:00
|
|
|
|
|
2025-04-21 06:23:42 +00:00
|
|
|
|
import WarehouseThroughput from "../../../../../modules//visualization/widgets/floating/cards/WarehouseThroughput";
|
|
|
|
|
import ProductivityDashboard from "../../../../../modules//visualization/widgets/floating/cards/ProductivityDashboard";
|
|
|
|
|
import FleetEfficiency from "../../../../../modules//visualization/widgets/floating/cards/FleetEfficiency";
|
2025-03-25 06:17:41 +00:00
|
|
|
|
|
|
|
|
|
interface Widget {
|
|
|
|
|
id: string;
|
|
|
|
|
name: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const WidgetsFloating = () => {
|
|
|
|
|
// const [widgets, setWidgets] = useState<Widget[]>([
|
|
|
|
|
// { id: "1", name: "Working State Widget" },
|
|
|
|
|
// { id: "2", name: "Floating Widget 2" },
|
|
|
|
|
// { id: "3", name: "Floating Widget 3" },
|
|
|
|
|
// { id: "4", name: "Floating Widget 4" },
|
|
|
|
|
// ]);
|
|
|
|
|
|
|
|
|
|
// Function to handle drag start
|
|
|
|
|
const handleDragStart = (
|
|
|
|
|
e: React.DragEvent<HTMLDivElement>,
|
|
|
|
|
widget: Widget
|
|
|
|
|
) => {
|
|
|
|
|
e.dataTransfer.setData("application/json", JSON.stringify(widget));
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
2025-04-11 05:54:23 +00:00
|
|
|
|
<div className="floatingWidgets-wrapper widgets-wrapper">
|
2025-03-25 06:17:41 +00:00
|
|
|
|
{/* {widgets.map((widget) => (
|
|
|
|
|
<div
|
|
|
|
|
key={widget.id}
|
|
|
|
|
className="floating"
|
|
|
|
|
draggable
|
|
|
|
|
onDragStart={(e) => handleDragStart(e, widget)}
|
|
|
|
|
>
|
|
|
|
|
{widget.name}
|
|
|
|
|
</div>
|
|
|
|
|
))} */}
|
|
|
|
|
{/* Floating 1 */}
|
|
|
|
|
<SimpleCard
|
2025-04-08 13:04:21 +00:00
|
|
|
|
header={"Today’s Earnings"}
|
2025-03-25 06:17:41 +00:00
|
|
|
|
icon={WalletIcon}
|
2025-04-11 05:54:23 +00:00
|
|
|
|
iconName={"WalletIcon"}
|
2025-03-25 06:17:41 +00:00
|
|
|
|
value={"$53,000"}
|
|
|
|
|
per={"+55%"}
|
|
|
|
|
/>
|
|
|
|
|
<SimpleCard
|
|
|
|
|
header={"Today’s Users"}
|
|
|
|
|
icon={GlobeIcon}
|
2025-04-11 05:54:23 +00:00
|
|
|
|
iconName={"GlobeIcon"}
|
2025-03-25 06:17:41 +00:00
|
|
|
|
value={"1,200"}
|
|
|
|
|
per={"+30%"}
|
|
|
|
|
/>
|
|
|
|
|
<SimpleCard
|
|
|
|
|
header={"New Clients"}
|
|
|
|
|
icon={DocumentIcon}
|
2025-04-11 05:54:23 +00:00
|
|
|
|
iconName={"DocumentIcon"}
|
2025-03-25 06:17:41 +00:00
|
|
|
|
value={"250"}
|
|
|
|
|
per={"+12%"}
|
|
|
|
|
/>
|
|
|
|
|
<SimpleCard
|
|
|
|
|
header={"Total Sales"}
|
|
|
|
|
icon={CartIcon}
|
2025-04-11 05:54:23 +00:00
|
|
|
|
iconName={"CartIcon"}
|
2025-03-25 06:17:41 +00:00
|
|
|
|
value={"$150,000"}
|
|
|
|
|
per={"+20%"}
|
|
|
|
|
/>{" "}
|
|
|
|
|
<WarehouseThroughput />
|
|
|
|
|
{/* <ProductivityDashboard /> */}
|
|
|
|
|
<FleetEfficiency />
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default WidgetsFloating;
|