From 9cdd44a5e65336cab2c2719fa5a2e16751792a7a Mon Sep 17 00:00:00 2001 From: Alice Dahan Date: Tue, 5 Nov 2024 11:17:32 +0100 Subject: [PATCH] =?UTF-8?q?refactor:=20ajout=20d'un=20prop=20onSubmit=20?= =?UTF-8?q?=C3=A0=20EntrepriseInput?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/source/components/conversation/EntrepriseInput.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/site/source/components/conversation/EntrepriseInput.tsx b/site/source/components/conversation/EntrepriseInput.tsx index bb6e47a74..a272f4684 100644 --- a/site/source/components/conversation/EntrepriseInput.tsx +++ b/site/source/components/conversation/EntrepriseInput.tsx @@ -12,13 +12,18 @@ import { resetCompany } from '@/store/actions/companyActions' import SelectedEntrepriseDetails from '../entreprise/SelectedEntrepriseDetails' -export default function EntrepriseInput() { +type Props = { + onSubmit?: (établissement: Entreprise | null) => void +} + +export default function EntrepriseInput({ onSubmit }: Props) { const companySIREN = useEngine().evaluate('entreprise . SIREN').nodeValue useSetEntrepriseFromUrssafConnection() const setEntreprise = useSetEntreprise() const dispatch = useDispatch() const handleCompanySubmit = (établissement: Entreprise | null) => { setEntreprise(établissement) + onSubmit?.(établissement) } const handleCompanyClear = () => { dispatch(resetCompany())