Skip to content

Commit

Permalink
fix: refactor FieldSearchBar to own component file
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin9foong committed Dec 2, 2024
1 parent 2045e75 commit 74071ed
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { BiSearch } from 'react-icons/bi'
import {
Box,
Divider,
Flex,
Icon,
Input,
InputGroup,
InputLeftElement,
TabList,
TabPanel,
TabPanels,
Expand All @@ -29,25 +24,7 @@ import {
MyInfoFieldPanel,
PaymentsInputPanel,
} from './field-panels'

const FieldSearchBar = ({
searchValue,
onChange,
}: {
searchValue: string
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
}) => (
<InputGroup>
<InputLeftElement>
<Icon as={BiSearch} color="secondary.500" fontSize="1.25rem" />
</InputLeftElement>
<Input
value={searchValue}
onChange={onChange}
placeholder="Search fields"
/>
</InputGroup>
)
import { FieldSearchBar } from './FieldSearchBar'

export const FieldListDrawer = (): JSX.Element => {
const { t } = useTranslation()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { BiSearch } from 'react-icons/bi'
import { Icon, Input, InputGroup, InputLeftElement } from '@chakra-ui/react'

export const FieldSearchBar = ({
searchValue,
onChange,
}: {
searchValue: string
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
}) => (
<InputGroup>
<InputLeftElement>
<Icon as={BiSearch} color="secondary.500" fontSize="1.25rem" />
</InputLeftElement>
<Input
value={searchValue}
onChange={onChange}
placeholder="Search fields"
/>
</InputGroup>
)

0 comments on commit 74071ed

Please sign in to comment.