import { Button, Group, Modal, Stack, Text, ThemeIcon } from "@mantine/core";
import { CheckCircle2 } from "lucide-react";

export interface ContractSignSuccessModalProps {
  opened: boolean;
  onClose: () => void;
  reference: string;
  message?: string;
  confirmLabel?: string;
}

export function ContractSignSuccessModal({
  opened,
  onClose,
  reference,
  message = "The contract has been signed and recorded.",
  confirmLabel = "Back to contract request",
}: ContractSignSuccessModalProps) {
  return (
    <Modal
      opened={opened}
      onClose={onClose}
      title="Contract signed successfully"
      centered
      radius="lg"
    >
      <Stack gap="md" align="center" ta="center">
        <ThemeIcon size={56} radius="xl" color="edr-green" variant="light">
          <CheckCircle2 size={28} />
        </ThemeIcon>
        <Text fw={600}>{reference}</Text>
        <Text size="sm" c="dimmed">
          {message}
        </Text>
        <Group justify="center" mt="xs">
          <Button color="edr-green" onClick={onClose}>
            {confirmLabel}
          </Button>
        </Group>
      </Stack>
    </Modal>
  );
}
