Skip to content

Commit

Permalink
content: update data subvention section description
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierJp committed Oct 14, 2024
1 parent 479504b commit bc53fde
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 15 deletions.
3 changes: 0 additions & 3 deletions .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ SENTRY_AUTH_TOKEN=
MATOMO_ENABLED=disabled
MATOMO_SITE_ID=
MATOMO_API_SITE_ID=
UPTIME_ROBOT_API_KEY=
ALTERNATIVE_SEARCH_ROUTE=
INSEE_DIRIGEANT_CLIENT_ID=
INSEE_DIRIGEANT_CLIENT_SECRET=
PROXY_API_KEY=
REDIS_URL=redis://127.0.0.1:6379
REDIS_ENABLED=false
Expand Down
50 changes: 38 additions & 12 deletions components/subventions-association-section/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
'use client';

import FAQLink from '#components-ui/faq-link';
import { Tag } from '#components-ui/tag';
import { DataSubvention } from '#components/administrations';
import { DJEPVA } from '#components/administrations';
import NonRenseigne from '#components/non-renseigne';
import { DataSectionClient } from '#components/section/data-section';
import { FullTable } from '#components/table/full';
import { EAdministration } from '#models/administrations/EAdministration';
Expand All @@ -13,6 +15,19 @@ import { formatCurrency } from '#utils/helpers';
import { useAPIRouteData } from 'hooks/fetch/use-API-route-data';
import { useMemo } from 'react';

const DataSubventionLink = () => (
<FAQLink
tooltipLabel="data.subvention"
to="https://datasubvention.beta.gouv.fr/"
>
Data.subvention est un outil développé par la <DJEPVA />. Il recense les
subventions demandées et reçues par une association.
<br />
Les données sont issues de issues de Chorus et du Fonjep (Fonds de
coopération de la jeunesse et de l’éducation populaire).
</FAQLink>
);

const SubventionDetails: React.FC<{ subventions: ISubventions }> = ({
subventions,
}) => {
Expand All @@ -37,13 +52,17 @@ const SubventionDetails: React.FC<{ subventions: ISubventions }> = ({
}, [subventions]);

return (
<p>
Cette association a demandé {subventionStats.totalSubventions}{' '}
subvention(s) depuis {subventionStats.mostRecentYear} dont{' '}
<b>{subventionStats.totalApproved} accordée(s)</b> pour un total de{' '}
<b>{formatCurrency(subventionStats.totalAmount)}</b>. Ces données sont
collectées par <DataSubvention />.
</p>
<>
Depuis {subventionStats.mostRecentYear}, cette association compte{' '}
{subventionStats.totalSubventions} demandes de subventions référencées
dans <DataSubventionLink />.
<p>
Parmi ces subventions :{' '}
<b>{subventionStats.totalApproved} ont été accordées</b> pour un total
de <b>{formatCurrency(subventionStats.totalAmount)}</b>. Le reste a été
refusé, est en cours d’instruction ou se situe dans un état inconnu.
</p>
</>
);
};

Expand All @@ -69,18 +88,23 @@ const SubventionsAssociation: React.FC<{
{(subventions) =>
!subventions || subventions?.length === 0 ? (
<>
Aucune demande de subvention n’a été trouvée pour cette association.
Aucune demande de subvention n’a été trouvée pour cette association
dans <DataSubventionLink />.
</>
) : (
<>
<SubventionDetails subventions={subventions} />
<FullTable
head={['Année', 'Dispositif', 'Montant', 'Label']}
head={['Année', 'Dispositif', 'Montant', 'État']}
body={subventions.map((subvention) => [
<strong>{subvention.year}</strong>,
<strong>{subvention.description}</strong>,
subvention.description ? (
<strong>{subvention.description}</strong>
) : (
<NonRenseigne />
),
formatCurrency(subvention.amount),
subvention.label && (
subvention.label ? (
<Tag
color={
subvention.label === 'Accordé'
Expand All @@ -92,6 +116,8 @@ const SubventionsAssociation: React.FC<{
>
{subvention.label}
</Tag>
) : (
<Tag color="default">Inconnu</Tag>
),
])}
/>
Expand Down

0 comments on commit bc53fde

Please sign in to comment.