Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3719 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3736 stevensc 1
import React from 'react';
3719 stevensc 2
import { IconButton, Typography } from '@mui/material';
3736 stevensc 3
import Edit from '@mui/icons-material/Edit';
3719 stevensc 4
 
3736 stevensc 5
import { useModal } from '@shared/hooks';
3719 stevensc 6
 
3736 stevensc 7
import { Card, CardContent, CardHeader } from '@shared/components';
8
import { IndustryForm } from './IndustryForm';
3719 stevensc 9
 
3736 stevensc 10
export function Industry({ uuid, industry, industries, updateGroup, edit }) {
11
  const { showModal, closeModal } = useModal();
3719 stevensc 12
 
3736 stevensc 13
  const handleEdit = () => {
14
    showModal(
15
      'Industria',
16
      <IndustryForm
17
        uuid={uuid}
18
        industry={industry}
19
        industries={industries}
20
        onSubmit={(newIndustry) => {
21
          updateGroup((prev) => ({ ...prev, industry: newIndustry }));
22
          closeModal();
23
        }}
24
      />
25
    );
26
  };
27
 
3719 stevensc 28
  return (
3736 stevensc 29
    <Card>
30
      <CardHeader
31
        title='Industria'
32
        renderAction={() => {
33
          if (!edit) return;
34
          return (
35
            <IconButton onClick={handleEdit}>
36
              <Edit />
37
            </IconButton>
38
          );
39
        }}
40
      />
3719 stevensc 41
 
3736 stevensc 42
      <CardContent>
43
        <Typography>{industry}</Typography>
44
      </CardContent>
45
    </Card>
3719 stevensc 46
  );
3736 stevensc 47
}
3719 stevensc 48
 
49
export default Industry;