Skip to content

Commit

Permalink
Replace land type with land type label in react search component
Browse files Browse the repository at this point in the history
  • Loading branch information
smdsgn committed Oct 16, 2024
1 parent ed01143 commit a29f580
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions assets/scripts/components/widgets/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,9 @@ export interface Territory {
source_id: string;
public_key: string;
area: number;
land_type: string;
land_type_label: string;
}

const territoryLabels: Record<string, string> = {
COMM: 'Commune',
EPCI: 'EPCI',
SCOT: 'SCOT',
DEPART: 'Département',
REGION: 'Région',
};

const primaryColor = '#313178';
const activeColor = '#4318FF';
const secondaryColor = '#a1a1f8';
Expand Down Expand Up @@ -232,7 +224,7 @@ const SearchBar: React.FC<SearchBarProps> = ({ createUrl }) => {
<div>
<TerritoryTitle>
<div>{territory.name}</div>
<Badge className="fr-badge">{territoryLabels[territory.land_type]}</Badge>
<Badge className="fr-badge">{territory.land_type_label}</Badge>
</TerritoryTitle>
<TerritoryDetails>
<div>Code INSEE: {territory.source_id}</div>
Expand Down

0 comments on commit a29f580

Please sign in to comment.