Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 485 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 485 Rev 593
Línea 1... Línea 1...
1
import React, { useEffect, useRef } from 'react'
1
import React, { useEffect } from 'react'
Línea 2... Línea 2...
2
 
2
 
3
import FormErrorFeedback from './FormErrorFeedback'
3
import FormErrorFeedback from './FormErrorFeedback'
Línea 4... Línea 4...
4
import useLocationAutocomplete from '../../hooks/useLocationAutocomplete'
4
import useLocationAutocomplete from '../../hooks/useLocationAutocomplete'
5
 
5
 
6
const UbicationInput = ({
6
const UbicationInput = ({
7
  onGetAddress = () => {},
7
  onGetAddress = () => {},
8
  settedQuery = '',
8
  settedQuery = '',
9
  placeholder = 'Ubicación',
-
 
10
}) => {
9
  placeholder = 'Ubicación',
Línea 11... Línea 10...
11
  const autoCompleteRef = useRef(null)
10
}) => {
12
  const { address, error } = useLocationAutocomplete(autoCompleteRef)
11
  const { address, error, ref } = useLocationAutocomplete()
13
 
12
 
Línea 20... Línea 19...
20
      <input
19
      <input
21
        type="text"
20
        type="text"
22
        id="location_search"
21
        id="location_search"
23
        name="location_search"
22
        name="location_search"
24
        className="form-control"
23
        className="form-control"
25
        ref={autoCompleteRef}
24
        ref={ref}
26
        placeholder={placeholder}
25
        placeholder={placeholder}
27
        defaultValue={settedQuery}
26
        defaultValue={settedQuery}
28
      />
27
      />
29
      {error && <FormErrorFeedback>{error}</FormErrorFeedback>}
28
      {error && <FormErrorFeedback>{error}</FormErrorFeedback>}
30
    </>
29
    </>