summaryrefslogtreecommitdiff
path: root/lib/shi-signature/upload-form.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/shi-signature/upload-form.tsx')
-rw-r--r--lib/shi-signature/upload-form.tsx40
1 files changed, 38 insertions, 2 deletions
diff --git a/lib/shi-signature/upload-form.tsx b/lib/shi-signature/upload-form.tsx
index 642cd1a5..4aa1c442 100644
--- a/lib/shi-signature/upload-form.tsx
+++ b/lib/shi-signature/upload-form.tsx
@@ -7,12 +7,22 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Alert, AlertDescription } from '@/components/ui/alert';
-import { Upload, Loader2, CheckCircle } from 'lucide-react';
+import { Upload, Loader2 } from 'lucide-react';
import { toast } from 'sonner';
+import { BuyerSignature } from '@/db/schema';
-export function BuyerSignatureUploadForm() {
+const DEFAULT_SHI_ADDRESS = '경기도 성남시 분당구 판교로 227번길 23';
+const DEFAULT_SHI_CEO_NAME = '최성안';
+
+interface BuyerSignatureUploadFormProps {
+ initialSignature?: BuyerSignature | null;
+}
+
+export function BuyerSignatureUploadForm({ initialSignature }: BuyerSignatureUploadFormProps) {
const [isUploading, setIsUploading] = useState(false);
const [preview, setPreview] = useState<string | null>(null);
+ const [shiAddress, setShiAddress] = useState(initialSignature?.shiAddress ?? DEFAULT_SHI_ADDRESS);
+ const [shiCeoName, setShiCeoName] = useState(initialSignature?.shiCeoName ?? DEFAULT_SHI_CEO_NAME);
const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const file = e.target.files?.[0];
@@ -30,6 +40,8 @@ export function BuyerSignatureUploadForm() {
setIsUploading(true);
const formData = new FormData(e.currentTarget);
+ formData.set('shiAddress', shiAddress);
+ formData.set('shiCeoName', shiCeoName);
try {
const result = await uploadBuyerSignature(formData);
@@ -74,6 +86,30 @@ export function BuyerSignatureUploadForm() {
</p>
</div>
+ <div className="space-y-2">
+ <Label htmlFor="shiAddress">삼성중공업 주소</Label>
+ <Input
+ id="shiAddress"
+ name="shiAddress"
+ value={shiAddress}
+ onChange={(event) => setShiAddress(event.target.value)}
+ required
+ disabled={isUploading}
+ />
+ </div>
+
+ <div className="space-y-2">
+ <Label htmlFor="shiCeoName">대표이사 이름</Label>
+ <Input
+ id="shiCeoName"
+ name="shiCeoName"
+ value={shiCeoName}
+ onChange={(event) => setShiCeoName(event.target.value)}
+ required
+ disabled={isUploading}
+ />
+ </div>
+
{preview && (
<div className="border rounded-lg p-4 bg-gray-50">
<Label className="text-sm font-medium mb-2 block">미리보기</Label>