Files
PolyMPR/routes/(apps)/students/partials/index.tsx
T
djalim 49bcc3083a
Check Deno code / Check Deno code (push) Has been cancelled
Tests / Unit tests (push) Has been cancelled
Tests / Integration tests (push) Has been cancelled
fix: faculty users are now recognized as employees
2026-05-05 15:29:02 +02:00

50 lines
1.2 KiB
TypeScript

import {
getPartialsConfig,
makePartials,
} from "$root/defaults/makePartials.tsx";
import { FreshContext } from "$fresh/server.ts";
import { isEmployee, State } from "$root/defaults/interfaces.ts";
// deno-lint-ignore require-await
export async function Index(
_request: Request,
context: FreshContext<State>,
) {
const employeeStatus = isEmployee(
(context.state as unknown as { session: Record<string, string> }).session,
);
return (
<div class="page-content">
<h2 class="page-title">Étudiants</h2>
<p>
Bienvenue{" "}
<strong>
{(context.state as unknown as { session: Record<string, string> })
.session.displayName}
</strong>
.
</p>
{employeeStatus && (
<p>
Consultez la{" "}
<a href="/students/consult" f-partial="/students/partials/consult">
liste des élèves
</a>{" "}
ou gérez les{" "}
<a
href="/students/promotions"
f-partial="/students/partials/promotions"
>
promotions
</a>
.
</p>
)}
</div>
);
}
export const config = getPartialsConfig();
export default makePartials(Index);