mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
27 lines
703 B
JavaScript
27 lines
703 B
JavaScript
import React, { useEffect, useState } from 'react';
|
|
import { fetchRegistrationFileGroups } from '@/app/actions/registerFileGroupAction';
|
|
import { useEstablishment } from '@/context/EstablishmentContext';
|
|
|
|
export default function RegistrationFileGroupList() {
|
|
const [groups, setGroups] = useState([]);
|
|
|
|
const { selectedEstablishmentId } = useEstablishment();
|
|
|
|
useEffect(() => {
|
|
fetchRegistrationFileGroups(selectedEstablishmentId).then((data) =>
|
|
setGroups(data)
|
|
);
|
|
}, []);
|
|
|
|
return (
|
|
<div>
|
|
<h2>Groupes de fichiers d'inscription</h2>
|
|
<ul>
|
|
{groups.map((group) => (
|
|
<li key={group.id}>{group.name}</li>
|
|
))}
|
|
</ul>
|
|
</div>
|
|
);
|
|
}
|