import React, { useState } from "react";
import {
    Dialog,
    DialogContent,
    DialogHeader,
    DialogTitle,
    DialogFooter,
} from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";

interface HasilUjiLabModalProps {
    open: boolean;
    onClose: () => void;
}

const HasilUjiLabModal: React.FC<HasilUjiLabModalProps> = ({
    open,
    onClose,
}) => {
    const [labResult, setLabResult] = useState("");

    const handleSave = () => {
        // Lakukan penyimpanan hasil uji lab
        onClose();
    };

    return (
        <Dialog open={open} onOpenChange={onClose}>
            <DialogContent>
                <DialogHeader>
                    <DialogTitle>Hasil Uji Lab</DialogTitle>
                </DialogHeader>
                <div className="my-4">
                    <Input
                        value={labResult}
                        onChange={(e) => setLabResult(e.target.value)}
                        placeholder="Masukkan hasil uji lab"
                    />
                </div>
                <DialogFooter>
                    <Button variant="outline" onClick={onClose}>
                        Batal
                    </Button>
                    <Button onClick={handleSave}>Simpan</Button>
                </DialogFooter>
            </DialogContent>
        </Dialog>
    );
};

export default HasilUjiLabModal;
