refacto: error and types

This commit is contained in:
Julien Froidefond
2025-02-27 21:59:14 +01:00
parent ea51ff53a9
commit 279f6c6e88
37 changed files with 800 additions and 684 deletions

View File

@@ -5,13 +5,16 @@ import { useTranslate } from "@/hooks/useTranslate";
interface ErrorMessageProps {
errorCode: string;
error?: Error;
variant?: "default" | "form";
}
export const ErrorMessage = ({ errorCode, variant = "default" }: ErrorMessageProps) => {
export const ErrorMessage = ({ errorCode, error, variant = "default" }: ErrorMessageProps) => {
const { t } = useTranslate();
const message = t(`errors.${errorCode}`);
console.error(error);
if (variant === "form") {
return (
<div