-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added required dependencies and files to use React Admin
- Loading branch information
1 parent
606ea23
commit 9e64e14
Showing
4 changed files
with
1,278 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// Route vers la page d'administration du site. | ||
// | ||
|
||
// Importation des dépendances. | ||
import dynamic from "next/dynamic"; | ||
import { redirect } from "next/navigation"; | ||
import type { Metadata } from "next"; | ||
import { unstable_setRequestLocale } from "next-intl/server"; | ||
|
||
// Importation des fonctions utilitaires. | ||
import { auth } from "@/utilities/next-auth"; | ||
|
||
// Importation des composants. | ||
const Administration = dynamic( () => import( "../components/administration" ), { | ||
ssr: false | ||
} ); | ||
|
||
// Déclaration des propriétés de la page. | ||
export const metadata: Metadata = { | ||
title: "Administration – Simple File Storage" | ||
}; | ||
|
||
// Affichage de la page. | ||
export default async function Page( { | ||
params: { locale } | ||
}: { | ||
params: { locale: string }; | ||
} ) | ||
{ | ||
// Définition de la langue de la page. | ||
unstable_setRequestLocale( locale ); | ||
|
||
// Vérification de la session utilisateur. | ||
const session = await auth(); | ||
|
||
if ( !session ) | ||
{ | ||
redirect( "/" ); | ||
} | ||
|
||
// Affichage du rendu HTML de la page. | ||
return <Administration />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// Composant de la page d'administration. | ||
// | ||
|
||
"use client"; | ||
|
||
// Importation des dépendances. | ||
import { Admin } from "react-admin"; | ||
|
||
export default function Administration() | ||
{ | ||
return <Admin />; | ||
} |
Oops, something went wrong.