summaryrefslogtreecommitdiff
path: root/lib/items-ship/table/add-items-dialog.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/items-ship/table/add-items-dialog.tsx')
-rw-r--r--lib/items-ship/table/add-items-dialog.tsx22
1 files changed, 7 insertions, 15 deletions
diff --git a/lib/items-ship/table/add-items-dialog.tsx b/lib/items-ship/table/add-items-dialog.tsx
index 4abf5f8a..fdfe54cc 100644
--- a/lib/items-ship/table/add-items-dialog.tsx
+++ b/lib/items-ship/table/add-items-dialog.tsx
@@ -24,7 +24,6 @@ import {
} from "../validations"
import { createShipbuildingItem } from "../service"
-import { ItemType } from "./excel/item-excel-template"
import { Plus } from "lucide-react"
import { toast } from "sonner"
import {
@@ -35,11 +34,6 @@ import {
SelectValue,
} from "@/components/ui/select"
-
-interface AddItemDialogProps {
- itemType?: ItemType
-}
-
const workTypes = [
{ value: "기장", label: "기장" },
{ value: "전장", label: "전장" },
@@ -48,7 +42,7 @@ const workTypes = [
{ value: "철의", label: "철의" },
] as const
-export function AddItemDialog({ itemType = 'shipbuilding' }: AddItemDialogProps) {
+export function AddItemDialog() {
const [open, setOpen] = React.useState(false)
const [isSubmitting, setIsSubmitting] = React.useState(false)
@@ -127,7 +121,7 @@ export function AddItemDialog({ itemType = 'shipbuilding' }: AddItemDialogProps)
<FormItem>
<FormLabel>아이템 코드</FormLabel>
<FormControl>
- <Input placeholder={`예: ${itemType === 'shipbuilding' ? 'SB001' : itemType === 'offshoreTop' ? 'OT001' : 'OH001'}`} {...field} />
+ <Input placeholder={'예: SB001'} {...field} />
</FormControl>
<FormMessage />
</FormItem>
@@ -172,7 +166,7 @@ export function AddItemDialog({ itemType = 'shipbuilding' }: AddItemDialogProps)
>
<FormControl>
<SelectTrigger>
- <SelectValue placeholder={`${itemType === 'shipbuilding' ? '기능(공종)' : itemType === 'offshoreTop' ? '예: TM, TS' : '예: HA, HE'}을 선택하세요`} />
+ <SelectValue placeholder={'기능(공종)을 선택하세요'} />
</SelectTrigger>
</FormControl>
<SelectContent>
@@ -190,10 +184,9 @@ export function AddItemDialog({ itemType = 'shipbuilding' }: AddItemDialogProps)
/>
{/* 조선 아이템인 경우 선종 필드 표시 */}
- {itemType === 'shipbuilding' && (
- <FormField
- control={form.control}
- name="shipTypes"
+ <FormField
+ control={form.control}
+ name="shipTypes"
render={({ field }) => (
<FormItem>
<FormLabel>선종</FormLabel>
@@ -203,8 +196,7 @@ export function AddItemDialog({ itemType = 'shipbuilding' }: AddItemDialogProps)
<FormMessage />
</FormItem>
)}
- />
- )}
+ />
<DialogFooter className="mt-4">
<Button type="submit" disabled={isSubmitting}>
{isSubmitting ? "추가 중..." : "추가"}