Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2641 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2641 Rev 2864
Línea 1... Línea 1...
1
import React, { useState } from 'react'
1
import React, { useState } from 'react'
2
import { useSelector } from 'react-redux'
2
import { useSelector } from 'react-redux'
3
import { Search } from '@mui/icons-material'
3
import { Search } from '@mui/icons-material'
Línea 4... Línea 4...
4
 
4
 
5
import SearchInput from '../components/UI/Input'
5
import Widget from '@components/UI/Widget'
Línea 6... Línea 6...
6
import Widget from '@app/components/UI/Widget'
6
import Input from '@components/UI/inputs/Input'
7
 
7
 
8
const withSearch = (Component = <></>, items = []) => {
8
export function withSearch(Component = <></>, items = []) {
9
  return function WithSearchComponent() {
9
  return function WithSearchComponent() {
Línea 10... Línea 10...
10
    const [query, setQuery] = useState('')
10
    const [query, setQuery] = useState('')
Línea 11... Línea 11...
11
    const labels = useSelector(({ intl }) => intl.labels)
11
    const labels = useSelector(({ intl }) => intl.labels)
12
 
12
 
13
    const handleInputChange = (e) => setQuery(e.target.value)
13
    const handleInputChange = (e) => setQuery(e.target.value)
14
 
14
 
15
    return (
15
    return (
16
      <Widget styles={{ paddingTop: '1rem' }}>
16
      <Widget styles={{ paddingTop: '1rem' }}>
17
        <SearchInput
17
        <Input
18
          onChange={handleInputChange}
-
 
19
          placeholder={labels.search}
-
 
20
          icon={Search}
18
          onChange={handleInputChange}
21
          width='auto'
19
          placeholder={labels.search}
22
          primary={false}
20
          icon={<Search />}
23
          mx={1}
21
          variant='search'
24
        />
22
        />
25
        <Component query={query} capsules={items} />
23
        <Component query={query} capsules={items} />
26
      </Widget>
-
 
27
    )
-