Skip to content

Commit

Permalink
Onglet actions liées sur la page indicateur
Browse files Browse the repository at this point in the history
  • Loading branch information
mariheck committed Jan 13, 2025
1 parent e6d8ecd commit ac45a2d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { EmptyCard } from '@/ui';
import ActionPicto from '../../PlansActions/FicheAction/ActionsLiees/ActionPicto';
import ActionsLieesListe from '../../PlansActions/FicheAction/ActionsLiees/ActionsLieesListe';

type Props = {
actionsIds: string[];
};

const ActionsLiees = ({ actionsIds }: Props) => {
const isEmpty = actionsIds.length === 0;

return isEmpty ? (
<EmptyCard
picto={(props) => <ActionPicto {...props} />}
title="Aucune action des référentiels n'est liée !"
size="xs"
/>
) : (
<div>
<div className="w-full border-b border-primary-3 mb-6">
<h6 className="text-lg h-[2.125rem] mb-5">
Actions du référentiel associées
</h6>
</div>
<ActionsLieesListe
actionsIds={actionsIds}
className="sm:grid-cols-2 md:grid-cols-3"
/>
</div>
);
};

export default ActionsLiees;
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { useCurrentCollectivite } from '@/app/core-logic/hooks/useCurrentCollect
import ScrollTopButton from '@/app/ui/buttons/ScrollTopButton';
import { BadgeACompleter } from '@/app/ui/shared/Badge/BadgeACompleter';
import { Badge, Tab, Tabs } from '@/ui';
import ActionsLieesListe from '../../PlansActions/FicheAction/ActionsLiees/ActionsLieesListe';
import { HeaderIndicateur } from '../Indicateur/detail/HeaderIndicateur';
import { useUpdateIndicateurDefinition } from '../Indicateur/useUpdateIndicateurDefinition';
import BadgeOpenData from '../components/BadgeOpenData';
import { TIndicateurDefinition } from '../types';
import ActionsLiees from './ActionsLiees';
import DonneesIndicateur from './DonneesIndicateur';
import FichesLiees from './FichesLiees';
import IndicateurToolbar from './IndicateurToolbar';
Expand Down Expand Up @@ -141,7 +141,7 @@ const IndicateurLayout = ({
{/* Actions des référentiels liées */}
{!isPerso ? (
<Tab label="Actions des référentiels liées">
<ActionsLieesListe
<ActionsLiees
actionsIds={(definition.actions ?? []).map((a) => a.id)}
/>
</Tab>
Expand Down

0 comments on commit ac45a2d

Please sign in to comment.