export const renderErrorAlert = (error, options = {}) => { const { className = 'alert alert-danger alert-dismissible py-1 px-2 small', role = 'alert' } = options; if (!error) return null; return (
{typeof error === 'string' ? error : 'An unexpected error occurred.'}
); }; export const resetErrorIfEditEnds = (editMode, setError) => { if (!editMode) setError(null); };