Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

897 B
Raw Blame
import {useDisclosure} from '@mantine/hooks';
import {Button, Dialog, Group, Text} from '@mantine/core';

interface ConfirmationDiaglogProps {
    message: string;
    onConfirm: () => void;
    buttonLabel: string;
}


export const confirm = () => {

}

export const ConfirmationDialog = ({message, onConfirm, buttonLabel}: ConfirmationDiaglogProps) => {
    const [opened, {close}] = useDisclosure(true);

    return (
        <>
            <Dialog opened={opened} withCloseButton onClose={close} size="lg" radius="md">
                <Text size="sm" mb="xs" fw={500}>
                    {message}
                </Text>

                <Group align="flex-end">
                    <Button onClick={() => {
                        onConfirm();
                        close();
                    }}>{buttonLabel}</Button>
                </Group>
            </Dialog>
        </>
    );
}