-
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.
feat: ajout archivage dans portefeuille
- Loading branch information
Showing
4 changed files
with
150 additions
and
1 deletion.
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
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
33 changes: 33 additions & 0 deletions
33
components/pilotage/OngletBeneficiairesAArchiverPilotage.tsx
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,33 @@ | ||
import { BeneficiaireWithActivity } from '../../interfaces/beneficiaire' | ||
|
||
import TableauBeneficiairesAArchiver from './TableauBeneficiairesAArchiver' | ||
|
||
import EmptyStateImage from 'assets/images/illustration-event-grey.svg' | ||
|
||
interface OngletBeneficiairesAArchiverPilotageProps { | ||
beneficiaires: BeneficiaireWithActivity[] | ||
} | ||
export default function OngletBeneficiairesAArchiverPilotage({ | ||
beneficiaires, | ||
}: OngletBeneficiairesAArchiverPilotageProps) { | ||
return ( | ||
<> | ||
{Boolean(beneficiaires && beneficiaires.length === 0) && ( | ||
<div className='flex flex-col justify-center items-center'> | ||
<EmptyStateImage | ||
focusable={false} | ||
aria-hidden={true} | ||
className='w-[360px] h-[200px]' | ||
/> | ||
<p className='mt-4 text-base-medium w-2/3 text-center'> | ||
Vous n’avez pas de bénéficiaires à archiver. | ||
</p> | ||
</div> | ||
)} | ||
|
||
{beneficiaires.length > 0 && ( | ||
<TableauBeneficiairesAArchiver beneficiaires={beneficiaires} /> | ||
)} | ||
</> | ||
) | ||
} |
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,58 @@ | ||
import { | ||
BaseBeneficiaire, | ||
BeneficiaireFromListe, | ||
} from '../../interfaces/beneficiaire' | ||
|
||
import { Badge } from 'components/ui/Indicateurs/Badge' | ||
import Table from 'components/ui/Table/Table' | ||
import TD from 'components/ui/Table/TD' | ||
import TDLink from 'components/ui/Table/TDLink' | ||
import { TH } from 'components/ui/Table/TH' | ||
import TR from 'components/ui/Table/TR' | ||
import { toLongMonthDate } from 'utils/date' | ||
|
||
interface TableauBeneficiairesAArchiverProps { | ||
beneficiaires: BeneficiaireFromListe[] | ||
} | ||
|
||
export default function TableauBeneficiairesAArchiver({ | ||
beneficiaires, | ||
}: TableauBeneficiairesAArchiverProps) { | ||
return ( | ||
<> | ||
{beneficiaires.length > 0 && ( | ||
<Table caption={{ text: 'Liste des bénéficiaires à archiver' }}> | ||
<thead> | ||
<TR isHeader={true}> | ||
<TH>Date</TH> | ||
<TH>Titre de l’animation collective</TH> | ||
<TH>Participants</TH> | ||
<TH>Voir le détail</TH> | ||
</TR> | ||
</thead> | ||
|
||
<tbody> | ||
{beneficiaires.map((benef: BaseBeneficiaire) => ( | ||
<TR key={benef.id}> | ||
<TD>{toLongMonthDate(benef.date)}</TD> | ||
<TD isBold>{benef.titre}</TD> | ||
<TD> | ||
<Badge | ||
count={benef.nombreInscrits} | ||
textColor='accent_1' | ||
bgColor='accent_1_lighten' | ||
size={6} | ||
/> | ||
</TD> | ||
<TDLink | ||
href={`/mes-jeunes/edition-rdv?idRdv=${benef.id}`} | ||
labelPrefix='Archiver le jeune' | ||
/> | ||
</TR> | ||
))} | ||
</tbody> | ||
</Table> | ||
)} | ||
</> | ||
) | ||
} |