import { useModalsManagerContext } from "@/contexts/ModalsManagerContext";
import Button from "@components/Button";
import ErrorIcon from "@components/icons/ErrorIcon";
import Box from "@re-box";
import Card from "@re-card";
import Text from "@re-text";

interface Props {
	message?: string;
	// onPress?: () => void;
}

const ErrorModal = ({ message = "Une erreur s'est produite" }: Props) => {
	const { closeModal } = useModalsManagerContext();
	return (
		<Card variant={"modal"}>
			<ErrorIcon />
			<Text variant={"gray"} fontWeight={"bold"}>
				{message}
			</Text>
			<Box style={{ width: "80%" }}>
				<Button
					variant={"fullError"}
					textVariants={"white"}
					label="Fermer"
					onPress={closeModal}
				/>
			</Box>
		</Card>
	);
};

export default ErrorModal;
