From d0d2eaa2de58a0c33e9a21604b126961403cd69e Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Wed, 14 May 2025 06:12:13 +0000
Subject: (최겸) 기술영업 조선, 해양Top, 해양 Hull 아이템 리스트 개발(CRUD,
 excel import/export/template)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/items-ship/table/update-items-sheet.tsx | 202 ----------------------------
 1 file changed, 202 deletions(-)
 delete mode 100644 lib/items-ship/table/update-items-sheet.tsx

(limited to 'lib/items-ship/table/update-items-sheet.tsx')

diff --git a/lib/items-ship/table/update-items-sheet.tsx b/lib/items-ship/table/update-items-sheet.tsx
deleted file mode 100644
index e021e145..00000000
--- a/lib/items-ship/table/update-items-sheet.tsx
+++ /dev/null
@@ -1,202 +0,0 @@
-"use client"
-
-import * as React from "react"
-import { zodResolver } from "@hookform/resolvers/zod"
-import { useForm } from "react-hook-form"
-
-import { Button } from "@/components/ui/button"
-import {
-  Sheet,
-  SheetClose,
-  SheetContent,
-  SheetDescription,
-  SheetFooter,
-  SheetHeader,
-  SheetTitle,
-} from "@/components/ui/sheet"
-import {
-  Form,
-  FormControl,
-  FormField,
-  FormItem,
-  FormLabel,
-  FormMessage,
-} from "@/components/ui/form"
-import { Input } from "@/components/ui/input"
-import {
-  Select,
-  SelectContent,
-  SelectItem,
-  SelectTrigger,
-  SelectValue,
-} from "@/components/ui/select"
-import { Textarea } from "@/components/ui/textarea"
-import { toast } from "sonner"
-
-import { modifyShipbuildingItem } from "../service"
-import { updateShipbuildingItemSchema, type UpdateShipbuildingItemSchema } from "../validations"
-
-const workTypes = [
-  { value: "기장", label: "기장" },
-  { value: "전장", label: "전장" },
-  { value: "선실", label: "선실" },
-  { value: "배관", label: "배관" },
-  { value: "철의", label: "철의" },
-] as const
-
-interface UpdateItemSheetProps {
-  item: {
-    id: number;
-    itemId: number;
-    workType: "기장" | "전장" | "선실" | "배관" | "철의";
-    shipTypes: string;
-    itemCode: string;
-    itemName: string;
-    description: string | null;
-    createdAt: Date;
-    updatedAt: Date;
-  }
-  open: boolean
-  onOpenChange: (open: boolean) => void
-}
-
-export function UpdateItemSheet({ item, open, onOpenChange }: UpdateItemSheetProps) {
-  const [isSubmitting, setIsSubmitting] = React.useState(false)
-  // 초기값 설정
-  const form = useForm<UpdateShipbuildingItemSchema>({
-    resolver: zodResolver(updateShipbuildingItemSchema),
-    defaultValues: {
-      itemCode: item.itemCode,
-      itemName: item.itemName,
-      description: item.description || "",
-      workType: item.workType,
-      shipTypes: item.shipTypes,
-    },
-  })
-
-  async function onSubmit(data: UpdateShipbuildingItemSchema) {
-    try {
-      setIsSubmitting(true)
-      const result = await modifyShipbuildingItem({ ...data, id: item.id })
-      
-      if (result.data) {
-        toast.success("아이템이 수정되었습니다.")
-        onOpenChange(false)
-      } else {
-        toast.error(result.error || "아이템 수정 중 오류가 발생했습니다. 다시 시도해주세요.")
-      }
-    } catch (error) {
-      toast.error("오류가 발생했습니다.")
-      console.error(error)
-    } finally {
-      setIsSubmitting(false)
-    }
-  }
-
-  return (
-    <Sheet open={open} onOpenChange={onOpenChange}>
-      <SheetContent>
-        <SheetHeader>
-          <SheetTitle>조선 아이템 수정</SheetTitle>
-          <SheetDescription>
-            조선 아이템 정보를 수정합니다. 수정할 필드를 입력해주세요.
-          </SheetDescription>
-        </SheetHeader>
-        <Form {...form}>
-          <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
-            <FormField
-              control={form.control}
-              name="itemCode"
-              render={({ field }) => (
-                <FormItem>
-                  <FormLabel>Material Group</FormLabel>
-                  <FormControl>
-                    <Input placeholder="Material Group을 입력하세요" {...field} />
-                  </FormControl>
-                  <FormMessage />
-                </FormItem>
-              )}
-            />
-            <FormField
-              control={form.control}
-              name="itemName"
-              render={({ field }) => (
-                <FormItem>
-                  <FormLabel>Description</FormLabel>
-                  <FormControl>
-                    <Input placeholder="Description을 입력하세요" {...field} />
-                  </FormControl>
-                  <FormMessage />
-                </FormItem>
-              )}
-            />
-            <FormField
-              control={form.control}
-              name="workType"
-              render={({ field }) => (
-                <FormItem>
-                  <FormLabel>기능(공종)</FormLabel>
-                  <Select
-                    onValueChange={field.onChange}
-                    defaultValue={field.value}
-                  >
-                    <FormControl>
-                      <SelectTrigger>
-                        <SelectValue placeholder="기능(공종)을 선택하세요" />
-                      </SelectTrigger>
-                    </FormControl>
-                    <SelectContent>
-                      {workTypes.map((type) => (
-                        <SelectItem key={type.value} value={type.value}>
-                          {type.label}
-                        </SelectItem>
-                      ))}
-                    </SelectContent>
-                  </Select>
-                  <FormMessage />
-                </FormItem>
-              )}
-            />
-            <FormField
-              control={form.control}
-              name="shipTypes"
-              render={({ field }) => (
-                <FormItem>
-                  <FormLabel>선종</FormLabel>
-                  <FormControl>
-                    <Input placeholder="선종을 입력하세요" {...field} />
-                  </FormControl>
-                  <FormMessage />
-                </FormItem>
-              )}
-            />
-            <FormField
-              control={form.control}
-              name="description"
-              render={({ field }) => (
-                <FormItem>
-                  <FormLabel>Size/Dimension</FormLabel>
-                  <FormControl>
-                    <Textarea
-                      placeholder="Size/Dimension을 입력하세요"
-                      {...field}
-                    />
-                  </FormControl>
-                  <FormMessage />
-                </FormItem>
-              )}
-            />
-            <SheetFooter>
-              <SheetClose asChild>
-                <Button variant="outline">취소</Button>
-              </SheetClose>
-              <Button type="submit" disabled={isSubmitting}>
-                {isSubmitting ? "수정 중..." : "수정"}
-              </Button>
-            </SheetFooter>
-          </form>
-        </Form>
-      </SheetContent>
-    </Sheet>
-  )
-} 
\ No newline at end of file
-- 
cgit v1.2.3

