Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 2718 Rev 3517
Línea -... Línea 1...
-
 
1
/* eslint-disable react/prop-types */
1
import React from 'react'
2
import React from 'react'
2
import { useForm } from "react-hook-form"
3
import { useForm } from "react-hook-form"
Línea 3... Línea 4...
3
 
4
 
-
 
5
export default function SearchList({
-
 
6
    title,
-
 
7
    fetchCallback,
-
 
8
    addTitle = '',
-
 
9
    addCallback = ''
-
 
10
}) {
4
export default function SearchList({ title, fetchCallback, addTitle = '', addCallback = '' }) {
11
 
-
 
12
    const { register, getValues } = useForm();
5
    const { register, getValues } = useForm();
13
 
6
    const handleSearch = () => {
14
    const handleSearch = () => {
7
        const searchValue = getValues("search");
-
 
8
        if (fetchCallback) {
-
 
9
            setTimeout(() => {
15
        const searchValue = getValues("search");
10
                fetchCallback(searchValue);
-
 
11
            }, [500])
-
 
12
        }
16
        if (fetchCallback) setTimeout(() => fetchCallback(searchValue), [500])
-
 
17
    };
13
    };
18
 
14
    return (
19
    return (
15
        <>
-
 
16
            {
20
        <>
17
                !!title && (
21
            {!!title &&
18
                    <div className="company-title">
22
                <div className="company-title">
19
                        <div
23
                    <div
20
                            className="section_admin_title_buttons"
24
                        className="section_admin_title_buttons"
21
                            style={!addTitle ? { width: '100%' } : {}}
25
                        style={!addTitle ? { width: '100%' } : {}}
22
                        >
26
                    >
23
                            <h1
27
                        <h1
24
                                className="title"
28
                            className="title"
25
                                style={!addTitle ? { flex: '1', textAlign: 'center' } : {}}
29
                            style={!addTitle ? { flex: '1', textAlign: 'center' } : {}}
26
                            >{title}</h1>
30
                        >{title}</h1>
27
                            {
31
                        {
28
                                (!!addTitle && !!addCallback)
32
                            (!!addTitle && !!addCallback)
29
                                &&
33
                            &&
30
                                <h2 className="title" onClick={addCallback}>
34
                            <h2 className="title" onClick={addCallback}>
31
                                    {addTitle}
35
                                {addTitle}
32
                                </h2>
36
                            </h2>
33
                            }
-
 
34
                        </div>
37
                        }
35
                    </div>
38
                    </div>
36
                )
39
                </div>
37
            }
40
            }
38
            <div className="company-title">
41
            <div className="company-title">
39
                <div className="search-box border-gray border-radius">
42
                <div className="search-box border-gray border-radius">
40
                    <div className="form-group">
43
                    <div className="form-group">