Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 2298 Rev 2299
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { useForm } from "react-hook-form"
2
import { useForm } from "react-hook-form"
Línea 3... Línea 3...
3
 
3
 
4
export default function SearchList({title, fetchCallback, addTitle='', addCallback=''}) {
4
export default function SearchList({ title, fetchCallback, addTitle = '', addCallback = '' }) {
5
    const { register, getValues } = useForm();
5
    const { register, getValues } = useForm();
6
    const handleSearch = () => {
6
    const handleSearch = () => {
7
        const searchValue = getValues("search");
7
        const searchValue = getValues("search");
8
        if(fetchCallback){
8
        if (fetchCallback) {
9
            setTimeout(() => {
9
            setTimeout(() => {
10
                fetchCallback(searchValue);
10
                fetchCallback(searchValue);
11
            }, [500])
11
            }, [500])
12
        }
12
        }
Línea 15... Línea 15...
15
        <>
15
        <>
16
            {
16
            {
17
                !!title && (
17
                !!title && (
18
                    <div className="company-title">
18
                    <div className="company-title">
19
                        <div className="section_admin_title_buttons">
19
                        <div className="section_admin_title_buttons">
20
                            <div style={{ float: "left" }}>
-
 
21
                                <h1 className="title"> {title} </h1>
20
                            <h1 className="title">{title}</h1>
22
                            </div>
-
 
23
                            {
21
                            {
24
                                !!addTitle && !!addCallback && (
22
                                (!!addTitle && !!addCallback)
25
                                    <div style={{ float: "right" }}>
-
 
26
                                        <button
-
 
27
                                            type="button"
-
 
28
                                            className="btn btn-primary btn-add"
-
 
29
                                            onClick={(e) => {
-
 
30
                                                e.preventDefault();
-
 
31
                                                addCallback();
-
 
32
                                            }}
-
 
33
                                        >
23
                                &&
34
                                            {addTitle}
24
                                <h2 className="title" onClick={addCallback}>
35
                                        </button>
-
 
36
                                    </div>
25
                                    {addTitle}
37
                                )
26
                                </h2>
38
                            }
27
                            }
39
                        </div>
28
                        </div>
40
                    </div>
29
                    </div>
41
                )
30
                )
42
            }
31
            }
43
 
-
 
44
            <div className="company-title">
32
            <div className="company-title">
45
                <div className="search-box border-gray border-radius">
33
                <div className="search-box border-gray border-radius">
46
                    <div className="form-group">
34
                    <div className="form-group">
47
                        <input
35
                        <input
48
                            type="text"
36
                            type="text"