mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 12:53:32 +00:00
45fe669f0a
* refactor: simplify excel import * chore: add external deepmerge utility * chore: create import map utilities * chore: increase size limits on uploads * style: small presentation tweaks * feat: resolve times on excel import, refs #508
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { MutableRefObject } from 'react';
|
|
import { Switch } from '@chakra-ui/react';
|
|
|
|
import { ProjectFileImportOptions } from '../../../../common/api/ontimeApi';
|
|
import ModalSplitInput from '../../ModalSplitInput';
|
|
|
|
import style from '../UploadModal.module.scss';
|
|
|
|
interface OntimeFileOptionsProps {
|
|
optionsRef: MutableRefObject<Partial<ProjectFileImportOptions>>;
|
|
updateOptions: <T extends keyof ProjectFileImportOptions>(field: T, value: ProjectFileImportOptions[T]) => void;
|
|
}
|
|
|
|
export default function OntimeFileOptions(props: OntimeFileOptionsProps) {
|
|
const { optionsRef, updateOptions } = props;
|
|
|
|
return (
|
|
<div className={style.uploadOptions}>
|
|
<span className={style.title}>Import options</span>
|
|
<ModalSplitInput field='' title='Only import rundown' description='All other project options will be kept'>
|
|
<Switch
|
|
variant='ontime-on-light'
|
|
onChange={(e) => {
|
|
updateOptions('onlyRundown', e.target.checked);
|
|
}}
|
|
defaultChecked={Boolean(optionsRef.current.onlyRundown)}
|
|
/>
|
|
</ModalSplitInput>
|
|
</div>
|
|
);
|
|
}
|