Skip to content

Commit

Permalink
refresh mcp
Browse files Browse the repository at this point in the history
  • Loading branch information
jonat75 committed Jul 22, 2024
1 parent 5e44ff4 commit b502675
Showing 1 changed file with 30 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { fr } from "@codegouvfr/react-dsfr";
import { Button } from "@codegouvfr/react-dsfr/Button";
import { Select } from "@codegouvfr/react-dsfr/Select";
import { Grid, GridCol } from "@design-system";
import { Grid, GridCol, Icon } from "@design-system";
import { getCompany } from "@globalActions/company";
import { useRouter } from "next/navigation";
import { signIn } from "next-auth/react";
Expand All @@ -24,31 +24,34 @@ export const SelectSiren = ({ sirenList, loadedSiren }: { loadedSiren?: string;
}, [currentSiren, router, loadedSiren]);

return (
<Grid>
<GridCol sm={3}>
<Select
label="SIREN"
nativeSelectProps={{ onChange: event => setCurrentSiren(event.target.value), value: currentSiren }}
>
<option value="">Sélectionner un siren</option>
{sirenList.map((value, key) => (
<option key={`siren-${key}`} value={value}>
{value}
</option>
))}
</Select>
</GridCol>
<GridCol sm={9}>
<div className={fr.cx("fr-pt-10v", "fr-pl-2v")}>
<span className={fr.cx("fr-icon-building-line", "fr-pr-2v")} aria-hidden="true"></span>
<span>{selectedCompanyName}</span>
</div>
</GridCol>
<Button
onClick={() => signIn("moncomptepro", { callbackUrl: `/mon-espace/mes-entreprises?siren=${currentSiren}` })}
>
Rafraichir MCP
</Button>
</Grid>
<>
<Grid>
<GridCol sm={3}>
<Select
label="SIREN"
nativeSelectProps={{ onChange: event => setCurrentSiren(event.target.value), value: currentSiren }}
>
<option value="">Sélectionner un siren</option>
{sirenList.map((value, key) => (
<option key={`siren-${key}`} value={value}>
{value}
</option>
))}
</Select>
</GridCol>
<GridCol sm={6}>
<div className={fr.cx("fr-pt-10v", "fr-pl-2v")}>
<span className={fr.cx("fr-icon-building-line", "fr-pr-2v")} aria-hidden="true"></span>
<span>{selectedCompanyName}</span>
</div>
</GridCol>
</Grid>
<div className={fr.cx("fr-pt-2v")}>
<Button onClick={() => signIn("moncomptepro", { redirect: true })}>
<Icon icon="fr-icon-refresh-line" />
Rafraichir MCP
</Button>
</div>
</>
);
};

0 comments on commit b502675

Please sign in to comment.