push
github
186 of 263 branches covered (0.0%)
Branch coverage included in aggregate %.
1 of 9 new or added lines in 1 file covered. (11.11%)
6317 of 7203 relevant lines covered (87.7%)
3.45 hits per line
1 |
import { SearchChip } from '@deriv-com/components'; |
1✔ |
2 |
import { ReactNode } from 'react'; |
1✔ |
3 |
|
1✔ |
4 |
export type SearchBlockProps = {
|
1✔ |
5 |
showSearchresults: (e: string) => void; |
1✔ |
6 |
content?: ReactNode; |
1✔ |
7 |
placeholder: string; |
1✔ |
|
onChange: (e: string) => void; |
1✔ |
9 |
}; |
1✔ |
10 |
|
1✔ |
11 |
export const SearchBlock = ({ |
1✔ |
12 |
showSearchresults, |
× |
13 |
content, |
× |
14 |
placeholder, |
× |
NEW
|
onChange, |
× |
16 |
}: SearchBlockProps) => { |
× |
17 |
return (
|
× |
18 |
<section className="flex w-full max-w-[1024px] flex-col gap-general-xl py-general-xl ">
|
× |
19 |
<SearchChip |
× |
20 |
placeholder={placeholder} |
× |
NEW
|
onChange={(value) => { |
× |
NEW
|
showSearchresults(value); |
× |
NEW
|
|
× |
NEW
|
if (onChange) {
|
× |
NEW
|
onChange(value); |
× |
NEW
|
} |
× |
NEW
|
}} |
× |
28 |
className="w-full "
|
× |
29 |
inputClassName="!bg-gradient-slate-110"
|
× |
30 |
/> |
× |
31 |
{content && content} |
× |
32 |
</section> |
× |
33 |
); |
× |
34 |
}; |
× |
35 |
|
1✔ |
36 |
export default SearchBlock; |
1✔ |