Files
sam-react-prod/src/components/material/ReceivingManagement/SuccessDialog.tsx

49 lines
1.5 KiB
TypeScript
Raw Normal View History

'use client';
/**
* ( / )
*/
import { CheckCircle2 } from 'lucide-react';
import { Button } from '@/components/ui/button';
import {
Dialog,
DialogContent,
} from '@/components/ui/dialog';
interface Props {
open: boolean;
type: 'inspection' | 'receiving';
lotNo?: string;
onClose: () => void;
}
export function SuccessDialog({ open, type, lotNo, onClose }: Props) {
const title = type === 'inspection' ? '수입검사가 합격 처리되었습니다.' : '입고 처리가 완료되었습니다.';
const message = type === 'inspection'
? `LOT번호: ${lotNo}\n입고 처리가 완료되었습니다.`
: `LOT번호: ${lotNo}\n재고에 반영되었습니다.`;
return (
<Dialog open={open} onOpenChange={(newOpen) => !newOpen && onClose()}>
<DialogContent className="max-w-sm">
<div className="flex flex-col items-center text-center py-6 space-y-4">
<div className="w-16 h-16 rounded-full bg-green-100 flex items-center justify-center">
<CheckCircle2 className="w-10 h-10 text-green-600" />
</div>
<div className="space-y-2">
<h3 className="text-lg font-semibold">{title}</h3>
<div className="text-sm text-muted-foreground whitespace-pre-line">
{message}
</div>
</div>
<Button onClick={onClose} className="w-full mt-4">
</Button>
</div>
</DialogContent>
</Dialog>
);
}