Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
import React from "react";
2
import { useState } from "react";
3
import ConfirmationBox from "../../../../../../shared/confirmation-box/ConfirmationBox";
4
 
5
const Job = (props) => {
6
  // props destructuring
7
  const {
8
    title,
9
    status,
10
    employment_type,
11
    last_date_of_application,
12
    link_users,
13
    link_view,
14
    link_admin,
15
    link_delete,
16
    onDelete,
17
  } = props;
18
 
19
  // states
20
  const [confirmationBoxShow, setConfirmationBoxShow] = useState(false);
21
 
22
  const handleConfirmationBoxShow = () => {
23
    setConfirmationBoxShow(!confirmationBoxShow);
24
  };
25
 
26
  const handleDelete = () => {
27
    onDelete(link_delete);
28
  };
29
  return (
30
    <div className="col-lg-3 col-md-3 col-sm-6">
31
      <div className="company_profile_info">
32
        <div className="company-up-info">
33
          <h3>{title}</h3>
34
          <h4>{status}</h4>
35
          <h4>{employment_type}</h4>
36
          <h4>{last_date_of_application}</h4>
37
          <ul>
38
            {!!link_users && (
39
              <li>
40
                <a href={link_users} title="" className="follow">
41
                  Postulados
42
                </a>
43
              </li>
44
            )}
45
            {!!link_view && (
46
              <li>
47
                <a href={link_view} title="" className="message-us">
48
                  Ver empleo
49
                </a>
50
              </li>
51
            )}
52
          </ul>
53
        </div>
54
        {!!link_admin && (
55
          <a href={link_admin} title="" className="view-more-pro cancelButton">
56
            Administrar
57
          </a>
58
        )}
59
        {!!link_delete && (
60
          <div style={{ position: "relative" }}>
61
            <a
62
              href="#"
63
              className="cancelButton"
64
              onClick={(e) => {
65
                e.preventDefault();
66
                handleConfirmationBoxShow();
67
              }}
68
            >
69
              Borrar
70
            </a>
71
            <ConfirmationBox
72
              show={confirmationBoxShow}
73
              onClose={handleConfirmationBoxShow}
74
              onAccept={handleDelete}
75
            />
76
          </div>
77
        )}
78
      </div>
79
    </div>
80
  );
81
};
82
 
83
export default Job;