Bluesky app fork with some witchin' additions 馃挮
1import {View} from 'react-native'
2import {SiftItem} from '@bsky.app/sift'
3
4import {atoms as a, useTheme} from '#/alf'
5import {MagnifyingGlass_Stroke2_Corner0_Rounded as MagnifyingGlassIcon} from '#/components/icons/MagnifyingGlass'
6import {Text} from '#/components/Typography'
7import {type AutocompleteItemProps} from './types'
8
9export function AutocompleteItemSearch({
10 active,
11 isFirst,
12 isLast,
13 props,
14 item,
15}: AutocompleteItemProps) {
16 const t = useTheme()
17
18 if (item.type !== 'search') return null
19
20 return (
21 <SiftItem
22 {...props}
23 style={s => [
24 a.py_sm,
25 a.px_md,
26 a.flex_row,
27 a.align_center,
28 a.gap_sm,
29 active || s.hovered || s.pressed ? [t.atoms.bg_contrast_25] : [],
30 isFirst && {
31 paddingTop: a.py_sm.paddingTop * 1.2,
32 },
33 isLast && {
34 paddingBottom: a.py_sm.paddingTop * 1.2,
35 },
36 ]}>
37 <View
38 style={[
39 a.align_center,
40 {
41 width: 40,
42 },
43 ]}>
44 <MagnifyingGlassIcon fill={t.atoms.text_contrast_low.color} size="xl" />
45 </View>
46 <Text style={[a.text_md, a.leading_snug]}>{item.value}</Text>
47 </SiftItem>
48 )
49}