Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TRA 15661] Rewords TransporterDisplay displayed information #3933

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as React from "react";
import { formatDate } from "../../../../common/datetime";
import "./TransporterDisplay.scss";
import { BsdTransporterInput } from "../../types";
import { TransportMode } from "@td/codegen-ui";
import { transportModeLabels } from "../../../../dashboard/constants";

type TransporterFieldProps = {
label: string;
Expand Down Expand Up @@ -73,37 +75,50 @@ export default function TransporterDisplay({ transporter }: TransporterProps) {
<TransporterField label="E-mail" value={transporter.company?.mail} />
</div>
</div>
<div className="fr-grid-row fr-grid-row--gutters ">
<div className="fr-col-12 fr-col-md-4">
<TransporterField
label="Récépissé n°"
value={transporter.recepisse?.number}
/>
{(!transporter.recepisse?.isExempted ||
transporter.company?.vatNumber ||
!transporter.transport?.mode?.includes(TransportMode.Road)) && (
<div className="fr-grid-row fr-grid-row--gutters ">
<div className="fr-col-12 fr-col-md-4">
<TransporterField
label="Récépissé n°"
value={transporter.recepisse?.number}
/>
</div>
<div className="fr-col-12 fr-col-md-4">
<TransporterField
label="Récépissé département"
value={transporter.recepisse?.department}
/>
</div>
<div className="fr-col-12 fr-col-md-4">
<TransporterField
label="Récépissé valide jusqu'au"
value={
transporter.recepisse?.validityLimit
? formatDate(transporter.recepisse?.validityLimit)
: ""
}
/>
</div>
</div>
<div className="fr-col-12 fr-col-md-4">
<TransporterField
label="Récépissé département"
value={transporter.recepisse?.department}
/>
</div>
<div className="fr-col-12 fr-col-md-4">
<TransporterField
label="Récépissé valide jusqu'au"
value={
transporter.recepisse?.validityLimit
? formatDate(transporter.recepisse?.validityLimit)
: ""
}
/>
)}
{transporter.recepisse?.isExempted && (
<div className="fr-grid-row fr-grid-row--gutters ">
<div className="fr-col-12 fr-col-md-4">
<TransporterField label="Exemption de récépissé" value="Oui" />
</div>
</div>
</div>
)}
<div className="fr-grid-row fr-grid-row--gutters ">
<div className="fr-col-12 fr-col-md-4">
<TransporterField
label="Mode de transport"
value={transporter?.transport?.mode}
/>
</div>
{transporter?.transport?.mode && (
<div className="fr-col-12 fr-col-md-4">
<TransporterField
label="Mode de transport"
value={transportModeLabels[transporter.transport.mode]}
/>
</div>
)}
<div className="fr-col-12 fr-col-md-4">
<TransporterField
label="Immatriculation"
Expand Down
Loading