Skip to content

Commit

Permalink
refactor: ajout d'un prop onSubmit à EntrepriseInput
Browse files Browse the repository at this point in the history
  • Loading branch information
liliced committed Nov 5, 2024
1 parent cdc8c73 commit 3c36b51
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion site/source/components/conversation/EntrepriseInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 3c36b51

Please sign in to comment.