feat(i18n): first shoot on translated errors

This commit is contained in:
Julien Froidefond
2025-02-27 15:05:44 +01:00
parent 41228e59bc
commit ea51ff53a9
14 changed files with 54 additions and 38 deletions

View File

@@ -1,11 +1,17 @@
"use client";
import { AlertCircle } from "lucide-react";
import { useTranslate } from "@/hooks/useTranslate";
interface ErrorMessageProps {
message: string;
errorCode: string;
variant?: "default" | "form";
}
export const ErrorMessage = ({ message, variant = "default" }: ErrorMessageProps) => {
export const ErrorMessage = ({ errorCode, variant = "default" }: ErrorMessageProps) => {
const { t } = useTranslate();
const message = t(`errors.${errorCode}`);
if (variant === "form") {
return (
<div