import { Modal, Text, Flex } from "@mantine/core";
import { Button } from "@/shadcn/components/ui/button";

interface StartAssessmentModalProps {
	assessmentId: string;
	isOpen: boolean;
	onClose: () => void;
	onConfirm: (assessmentId: string) => void;
}

export default function StartAssessmentModal({
	assessmentId,
	isOpen,
	onClose,
	onConfirm,
}: StartAssessmentModalProps) {
	return (
		<Modal opened={isOpen} onClose={onClose} title="Konfirmasi Mulai Asesmen">
			<Text>Apakah Anda yakin ingin memulai asesmen ini?</Text>
			<Flex gap="sm" justify="flex-end" mt="md">
				<Button variant="outline" onClick={onClose}>
					Batal
				</Button>
				<Button
					onClick={() => {
						onConfirm(assessmentId); // Menggunakan assessmentId saat konfirmasi
					}}
				>
					Mulai Asesmen
				</Button>
			</Flex>
		</Modal>
	);
}
