Skip to content

Commit

Permalink
suite
Browse files Browse the repository at this point in the history
  • Loading branch information
eletallbetagouv committed Aug 14, 2024
1 parent 4a3b356 commit 19d0f5a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {CompanyWebsiteVendor} from './CompanyWebsiteVendor'
import {NoSearchResult} from './lib/NoSearchResult'

interface Props {
dividerAbove?: boolean
companies: CompanySearchResult[]
report: PartialReport & Pick<Report, 'step0' | 'step1'>
onSubmit: (selected: CompanySearchResult, vendor?: string) => void
Expand All @@ -25,7 +26,7 @@ interface Form {
result: string
}

export const CompanySearchResultComponent = ({companies, report: report, onSubmit}: Props) => {
export const CompanySearchResultComponent = ({companies, report: report, onSubmit, dividerAbove = true}: Props) => {
const {m} = useI18n()
const _analytic = useAnalyticContext()
const [selected, setSelected] = useState<CompanySearchResult | undefined>()
Expand All @@ -49,7 +50,7 @@ export const CompanySearchResultComponent = ({companies, report: report, onSubmi
return (
<>
<Animate>
<div className="mt-6 pt-10 border-t-[1px] border-0 border-solid border-gray-200">
<div className={`mt-6 ${dividerAbove ? 'pt-10 border-t-[1px] border-0 border-solid border-gray-200' : ''}`}>
{companies.length === 0 ? (
<div id="CompanySearchResult">
<NoSearchResult text={m.noMatchingCompany} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function NewCompanyIdentification({
const [geographicalRestriction, setGeographicalRestriction] = useState(false)
const [mode, setMode] = useState<'search' | 'cannotFind' | 'cannotFindConfirmed' | 'foreign'>('search')
const showSearchResults = mode === 'search'

const emptyResults = true
const companyKind = getCompanyKind(draft)
return (
<div>
Expand Down Expand Up @@ -118,7 +118,14 @@ export function NewCompanyIdentification({
</div>
</>
}
{showSearchResults && <CompanySearchResultComponent companies={searchResults} onSubmit={() => {}} report={draft} />}
{showSearchResults && (
<CompanySearchResultComponent
dividerAbove={false}
companies={emptyResults ? [] : searchResults}
onSubmit={() => {}}
report={draft}
/>
)}
{(mode === 'cannotFind' || mode === 'cannotFindConfirmed') && (
<Animate autoScrollTo>
<div>
Expand Down

0 comments on commit 19d0f5a

Please sign in to comment.