Skip to content

Commit

Permalink
feat: add tracking on radio agreement select
Browse files Browse the repository at this point in the history
  • Loading branch information
victor committed Jan 9, 2025
1 parent 844dc3d commit 3175ea5
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { getEnterpriseAgreements } from "./utils";
import Button from "@codegouvfr/react-dsfr/Button";
import Alert from "@codegouvfr/react-dsfr/Alert";
import { useState } from "react";
import { useEnterpriseAgreementSearchTracking } from "./tracking";

type Props = {
enterprise: Omit<Enterprise, "complements">;
Expand All @@ -19,6 +20,8 @@ export const EnterpriseAgreementSelectionForm = ({
goBack,
onAgreementSelect,
}: Props) => {
const { emitSelectEnterpriseAgreementEvent } =
useEnterpriseAgreementSearchTracking();
const [agreement, setAgreement] = useState<EnterpriseAgreement | undefined>();
const agreements = getEnterpriseAgreements(enterprise.conventions);
return (
Expand Down Expand Up @@ -50,6 +53,7 @@ export const EnterpriseAgreementSelectionForm = ({
onChange: () => {
onAgreementSelect(agreement);
setAgreement(agreement);
emitSelectEnterpriseAgreementEvent(`idcc${agreement.id}`);
},
}
: {}),
Expand Down

0 comments on commit 3175ea5

Please sign in to comment.