2021-06-24 01:05:22 +05:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
import { Button, Divider, Header, Tab } from 'semantic-ui-react';
|
2023-01-24 18:53:13 +01:00
|
|
|
import { usePopup } from '../../../lib/popup';
|
2021-06-24 01:05:22 +05:00
|
|
|
|
|
|
|
import InformationEdit from './InformationEdit';
|
2023-01-24 18:53:13 +01:00
|
|
|
import DeleteStep from '../../DeleteStep';
|
2021-06-24 01:05:22 +05:00
|
|
|
|
|
|
|
import styles from './GeneralPane.module.scss';
|
|
|
|
|
|
|
|
const GeneralPane = React.memo(({ name, onUpdate, onDelete }) => {
|
|
|
|
const [t] = useTranslation();
|
|
|
|
|
2023-01-24 18:53:13 +01:00
|
|
|
const DeletePopup = usePopup(DeleteStep);
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
return (
|
|
|
|
<Tab.Pane attached={false} className={styles.wrapper}>
|
|
|
|
<InformationEdit
|
|
|
|
defaultData={{
|
|
|
|
name,
|
|
|
|
}}
|
|
|
|
onUpdate={onUpdate}
|
|
|
|
/>
|
|
|
|
<Divider horizontal section>
|
|
|
|
<Header as="h4">
|
|
|
|
{t('common.dangerZone', {
|
|
|
|
context: 'title',
|
|
|
|
})}
|
|
|
|
</Header>
|
|
|
|
</Divider>
|
|
|
|
<div className={styles.action}>
|
|
|
|
<DeletePopup
|
2023-01-24 18:53:13 +01:00
|
|
|
title="common.deleteProject"
|
|
|
|
content="common.areYouSureYouWantToDeleteThisProject"
|
|
|
|
buttonContent="action.deleteProject"
|
2021-06-24 01:05:22 +05:00
|
|
|
onConfirm={onDelete}
|
|
|
|
>
|
|
|
|
<Button className={styles.actionButton}>
|
|
|
|
{t('action.deleteProject', {
|
|
|
|
context: 'title',
|
|
|
|
})}
|
|
|
|
</Button>
|
|
|
|
</DeletePopup>
|
|
|
|
</div>
|
|
|
|
</Tab.Pane>
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
GeneralPane.propTypes = {
|
|
|
|
name: PropTypes.string.isRequired,
|
|
|
|
onUpdate: PropTypes.func.isRequired,
|
|
|
|
onDelete: PropTypes.func.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default GeneralPane;
|