Skip to content

Commit b7a17d7

Browse files
committed
feat: add loading page
1 parent 99f71a2 commit b7a17d7

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

messages/ar.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"subtitle": "أدخل رقم القضية لعرض تفاصيلها.",
55
"button": "بحث"
66
},
7+
"loading": {
8+
"title": "تحميل"
9+
},
710
"error": {
811
"title": "حدث خطأ ما!",
912
"subtitle": "القضية التي تبحث عنها غير موجودة بعد.",

messages/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"subtitle": "Enter the case number to view its details.",
55
"button": "Search"
66
},
7+
"loading": {
8+
"title": "LOADING"
9+
},
710
"error": {
811
"title": "Something went wrong!",
912
"subtitle": "The case you are looking for doesn't exist yet.",

messages/es.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"subtitle": "Introduzca el número del caso para ver los detalles.",
55
"button": "Buscar"
66
},
7+
"loading": {
8+
"title": "CARGANDO"
9+
},
710
"error": {
811
"title": "Algo salió mal",
912
"subtitle": "El caso que estás buscando no existe aún.",

src/app/[locale]/loading.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"use client";
2+
3+
import React from "react";
4+
5+
import clsx from "clsx";
6+
import { useTranslations } from "next-intl";
7+
8+
const Loading: React.FC = () => {
9+
const t = useTranslations("loading");
10+
11+
return (
12+
<div className="m-auto">
13+
<div
14+
className={clsx(
15+
"w-16 h-16 border-4 border-r-white-background border-primary-blue",
16+
"rounded-full animate-spin mx-auto",
17+
)}
18+
/>
19+
<span
20+
className={
21+
"mt-2 font-semibold text-primary-blue text-center animate-pulse block"
22+
}
23+
>
24+
{t("title")}
25+
</span>
26+
</div>
27+
);
28+
};
29+
30+
export default Loading;

0 commit comments

Comments
 (0)