Rev 3719 | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React from 'react';
import { IconButton, Typography } from '@mui/material';
import { Edit } from '@mui/icons-material';
import { useModal } from '@shared/hooks';
import { Card, CardContent, CardHeader } from '@shared/components';
import { WebsiteForm } from './WebsiteForm';
export function Website({ uuid, website, updateGroup, edit }) {
const { showModal, closeModal } = useModal();
const handleEdit = () => {
showModal(
'Página web',
<WebsiteForm
uuid={uuid}
website={website}
onSubmit={(data) => {
updateGroup((prev) => ({ ...prev, website: data }));
closeModal();
}}
/>
);
};
return (
<Card>
<CardHeader
title='Página web'
renderAction={() => {
if (!edit) return;
return (
<IconButton onClick={handleEdit}>
<Edit />
</IconButton>
);
}}
/>
<CardContent>
<Typography>{website || 'No hay página web'}</Typography>
</CardContent>
</Card>
);
}