diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-28 02:13:30 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-28 02:13:30 +0000 |
| commit | ef4c533ebacc2cdc97e518f30e9a9350004fcdfb (patch) | |
| tree | 345251a3ed0f4429716fa5edaa31024d8f4cb560 /lib/vendor-investigation/table/items-dialog.tsx | |
| parent | 9ceed79cf32c896f8a998399bf1b296506b2cd4a (diff) | |
~20250428 작업사항
Diffstat (limited to 'lib/vendor-investigation/table/items-dialog.tsx')
| -rw-r--r-- | lib/vendor-investigation/table/items-dialog.tsx | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/lib/vendor-investigation/table/items-dialog.tsx b/lib/vendor-investigation/table/items-dialog.tsx new file mode 100644 index 00000000..5d010ff4 --- /dev/null +++ b/lib/vendor-investigation/table/items-dialog.tsx @@ -0,0 +1,73 @@ +"use client" + +import * as React from "react" +import { + Sheet, + SheetContent, + SheetDescription, + SheetHeader, + SheetTitle, + SheetFooter, +} from "@/components/ui/sheet" +import { Button } from "@/components/ui/button" +import { ScrollArea } from "@/components/ui/scroll-area" +import { PossibleItem } from "@/config/vendorInvestigationsColumnsConfig" + +interface ItemsDrawerProps { + open: boolean + onOpenChange: (open: boolean) => void + investigationId: number | null + items: PossibleItem[] +} + +export function ItemsDrawer({ + open, + onOpenChange, + investigationId, + items, +}: ItemsDrawerProps) { + return ( + <Sheet open={open} onOpenChange={onOpenChange}> + <SheetContent className="sm:max-w-md"> + <SheetHeader> + <SheetTitle>Possible Items</SheetTitle> + <SheetDescription> + {items.length > 0 + ? `Showing ${items.length} items for investigation #${investigationId}` + : `No items found for investigation #${investigationId}`} + </SheetDescription> + </SheetHeader> + <ScrollArea className="max-h-[70vh] mt-6 pr-4"> + {items.length > 0 ? ( + <div className="space-y-4"> + {items.map((item, index) => ( + <div + key={index} + className="flex flex-col gap-2 p-3 rounded-lg border" + > + <div className="flex justify-between items-start"> + <h4 className="font-medium">{item.itemName || "Unknown Item"}</h4> + {item.itemName && ( + <span className="text-xs bg-muted px-2 py-1 rounded"> + {item.itemCode} + </span> + )} + </div> + + + </div> + ))} + </div> + ) : ( + <div className="text-center py-6 text-muted-foreground"> + No items available + </div> + )} + </ScrollArea> + <SheetFooter className="mt-4"> + <Button onClick={() => onOpenChange(false)}>Close</Button> + </SheetFooter> + </SheetContent> + </Sheet> + ) +}
\ No newline at end of file |
