import React from "react"; type ButtonType = 'alert' | 'danger' | 'informatif' | 'success'; interface ConfirmButtonProps { text: string; callBackFunction?: () => void; buttonType?: ButtonType; } export default function ConfirmButton( { text, callBackFunction, buttonType = 'success' }: ConfirmButtonProps) { function getButtonType(alertType: ButtonType): string { switch (alertType) { case 'alert': return 'bg-warning'; case 'danger': return 'bg-error'; case 'informatif': return 'bg-info'; case 'success': default: return 'bg-success'; } } const applyType: string = getButtonType(buttonType); return ( ) }