mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 15:30:57 +00:00
- Implemented ExamStageActions component to manage actions related to exam booking and payment based on application status. - Added mock-base-query for development, providing a partial mock backend for various API endpoints. - Introduced mock-data for simulating responses in the mock-base-query, covering profiles, vessels, applications, licenses, exams, and notifications.
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import { Button, Modal, Stack, Text, TextInput } from '@mantine/core';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { ModalFooter } from '@ema-platform/ui';
|
|
|
|
interface Props {
|
|
opened: boolean;
|
|
name: string;
|
|
onNameChange: (value: string) => void;
|
|
creating: boolean;
|
|
onClose: () => void;
|
|
onCreate: () => void;
|
|
}
|
|
|
|
/** Starts a draft from the live design, or the built-in layout if there is none. */
|
|
export function NewVersionModal({
|
|
opened,
|
|
name,
|
|
onNameChange,
|
|
creating,
|
|
onClose,
|
|
onCreate,
|
|
}: Props) {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<Modal opened={opened} onClose={onClose} title={t('designer.newVersion', 'New version')}>
|
|
<Stack>
|
|
<TextInput
|
|
label={t('designer.name', 'Version name')}
|
|
value={name}
|
|
onChange={(e) => onNameChange(e.currentTarget.value)}
|
|
withAsterisk
|
|
/>
|
|
<Text size="xs" c="dimmed">
|
|
{t(
|
|
'designer.newHint',
|
|
'Starts from the live design, or the built-in layout if this type has none.',
|
|
)}
|
|
</Text>
|
|
<ModalFooter>
|
|
<Button variant="default" onClick={onClose}>
|
|
{t('common.cancel', 'Cancel')}
|
|
</Button>
|
|
<Button loading={creating} disabled={!name.trim()} onClick={onCreate}>
|
|
{t('designer.create', 'Create')}
|
|
</Button>
|
|
</ModalFooter>
|
|
</Stack>
|
|
</Modal>
|
|
);
|
|
}
|