test(front end): added in card test but removing
This commit is contained in:
58
frontend/src/components/dashboard/AddCards.tsx
Normal file
58
frontend/src/components/dashboard/AddCards.tsx
Normal file
@@ -0,0 +1,58 @@
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog";
|
||||
|
||||
import { useCardStore } from "@/lib/store/useCardStore";
|
||||
import { toast } from "sonner";
|
||||
|
||||
export function AddCards() {
|
||||
const { cards, addCard } = useCardStore();
|
||||
|
||||
const handleAddPPOO = () => {
|
||||
const existingCard = cards.filter((c) => c.i === "PPOO");
|
||||
//console.log(existingCard.length);
|
||||
//console.log(data);
|
||||
if (existingCard.length != 0) {
|
||||
toast.error(`PPOO already exists no card will be added`);
|
||||
return;
|
||||
}
|
||||
addCard({
|
||||
i: "PPOO",
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: 5,
|
||||
h: 3,
|
||||
isResizable: true,
|
||||
isDraggable: true,
|
||||
});
|
||||
};
|
||||
return (
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
<Button variant="outline">Add Cards</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="sm:max-w-[425px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Cards</DialogTitle>
|
||||
<DialogDescription>
|
||||
Please add a card below.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<Button onClick={handleAddPPOO} className="w-48">
|
||||
PPOO
|
||||
</Button>
|
||||
|
||||
<DialogFooter>
|
||||
<Button type="submit">Save changes</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
68
frontend/src/components/dashboard/DashBoard.tsx
Normal file
68
frontend/src/components/dashboard/DashBoard.tsx
Normal file
@@ -0,0 +1,68 @@
|
||||
export default function DashBoard() {
|
||||
// const handleResizeStop = (newLayout: any, newItem: any) => {
|
||||
// updateCard(
|
||||
// newItem.i,
|
||||
// newLayout.filter((n: any) => n.i === newItem.i)[0]
|
||||
// ); // Store the new layout in state
|
||||
// };
|
||||
|
||||
// const handleDragStop = (newLayout: any, newItem: any) => {
|
||||
// updateCard(
|
||||
// newItem.i,
|
||||
// newLayout.filter((n: any) => n.i === newItem.i)[0]
|
||||
// ); // Persist the updated layout with custom name
|
||||
// };
|
||||
|
||||
return (
|
||||
<div className="ml-5 w-11/12 h-9/10">
|
||||
<p>Comming soon...</p>
|
||||
{/* <ResizablePanelGroup
|
||||
direction="horizontal"
|
||||
//className="rounded-lg border"
|
||||
autoSaveId="persistence"
|
||||
>
|
||||
<ResizablePanel>
|
||||
<ResizablePanelGroup direction="vertical">
|
||||
<ResizablePanel>
|
||||
<div className="overflow: auto">
|
||||
<Lots />
|
||||
</div>
|
||||
</ResizablePanel>
|
||||
<ResizableHandle />
|
||||
<ResizablePanel>
|
||||
<ResizablePanelGroup direction="horizontal">
|
||||
<ResizablePanel>
|
||||
<LabelLog />
|
||||
</ResizablePanel>
|
||||
<ResizableHandle />
|
||||
<ResizablePanel>
|
||||
<OcpLogs />
|
||||
</ResizablePanel>
|
||||
</ResizablePanelGroup>
|
||||
</ResizablePanel>
|
||||
</ResizablePanelGroup>
|
||||
</ResizablePanel>
|
||||
<ResizableHandle />
|
||||
<ResizablePanel defaultSize={25}>
|
||||
<ResizablePanelGroup direction="vertical">
|
||||
{server[0].value === "usday1vms006" && (
|
||||
<ResizablePanel className="max-h-[300px]">
|
||||
<WrapperManualTrigger />
|
||||
</ResizablePanel>
|
||||
)}
|
||||
{server[0].value === "usday1vms006" && (
|
||||
<ResizablePanel className="max-h-[300px]">
|
||||
<WrapperManualTrigger />
|
||||
</ResizablePanel>
|
||||
)}
|
||||
|
||||
<ResizableHandle />
|
||||
<ResizablePanel>
|
||||
<PrinterStatus />
|
||||
</ResizablePanel>
|
||||
</ResizablePanelGroup>
|
||||
</ResizablePanel>
|
||||
</ResizablePanelGroup> */}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user