-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajoute les étapes à l'export PDF de la fiche action
- Loading branch information
Showing
3 changed files
with
69 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
54 changes: 54 additions & 0 deletions
54
...sitions.react/src/app/pages/collectivite/PlansActions/ExportPdf/FicheActionPdf/Etapes.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,54 @@ | ||
import React from 'react'; | ||
|
||
import { Card, Stack, Title } from '@/app/ui/export-pdf/components'; | ||
|
||
import { RouterOutput } from '@/api/utils/trpc/client'; | ||
import classNames from 'classnames'; | ||
import { Text } from '@react-pdf/renderer'; | ||
import { tw } from '@/app/ui/export-pdf/utils'; | ||
|
||
const EtapesCard = () => { | ||
<Card wrap={false}> | ||
<Title variant="h4" className="text-primary-8"> | ||
Indicateurs de suivi | ||
</Title> | ||
</Card>; | ||
}; | ||
|
||
type Props = { | ||
etapes: RouterOutput['plans']['fiches']['etapes']['list']; | ||
}; | ||
|
||
const Etapes = ({ etapes }: Props) => { | ||
const etapesRealiseesCount = etapes.filter((etape) => etape.realise).length; | ||
|
||
return ( | ||
<Card wrap={false}> | ||
<Title variant="h4" className="text-primary-8"> | ||
Étapes {etapes.length > 0 && `${etapesRealiseesCount}/${etapes.length}`} | ||
</Title> | ||
<Stack gap={3}> | ||
{etapes.map((etape) => ( | ||
<Stack | ||
key={etape.id} | ||
gap={2} | ||
className="w-[95%] flex-row items-start text-xs text-grey-8 leading-6" | ||
> | ||
<Text style={tw('ml-1')}>•</Text> | ||
<Text | ||
style={tw( | ||
classNames({ | ||
'line-through !text-grey-6': etape.realise, | ||
}) | ||
)} | ||
> | ||
{etape.nom} | ||
</Text> | ||
</Stack> | ||
))} | ||
</Stack> | ||
</Card> | ||
); | ||
}; | ||
|
||
export default Etapes; |
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