You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.2 KiB
63 lines
1.2 KiB
1 year ago
|
type FileFormikLocations = {
|
||
|
anvils: {
|
||
|
[anvilUuid: string]: {
|
||
|
active: boolean;
|
||
|
};
|
||
|
};
|
||
|
drHosts: {
|
||
|
[hostUuid: string]: {
|
||
|
active: boolean;
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
|
||
|
type FileFormikFile = {
|
||
|
file?: File;
|
||
|
locations?: FileFormikLocations;
|
||
|
name: string;
|
||
|
type?: FileType;
|
||
|
uuid: string;
|
||
|
};
|
||
|
|
||
|
type FileFormikValues = {
|
||
|
[fileUuid: string]: FileFormikFile;
|
||
|
};
|
||
|
|
||
|
/** ---------- Component types ---------- */
|
||
|
|
||
|
/** FileInputGroup */
|
||
|
|
||
|
type FileInputGroupOptionalProps = {
|
||
|
showSyncInputGroup?: boolean;
|
||
|
showTypeInput?: boolean;
|
||
|
};
|
||
|
|
||
|
type FileInputGroupProps = FileInputGroupOptionalProps & {
|
||
|
anvils: APIAnvilOverviewList;
|
||
|
drHosts: APIHostOverviewList;
|
||
|
fileUuid: string;
|
||
|
formik: ReturnType<typeof import('formik').useFormik<FileFormikValues>>;
|
||
|
};
|
||
|
|
||
|
/** AddFileForm */
|
||
|
|
||
|
type UploadFiles = {
|
||
|
[fileUuid: string]: Pick<FileFormikFile, 'name' | 'uuid'> & {
|
||
|
progress: number;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
type AddFileFormProps = Pick<FileInputGroupProps, 'anvils' | 'drHosts'>;
|
||
|
|
||
|
/** EditFileForm */
|
||
|
|
||
|
type EditFileFormProps = Pick<FileInputGroupProps, 'anvils' | 'drHosts'> & {
|
||
|
previous: APIFileDetail;
|
||
|
};
|
||
|
|
||
|
/** UploadFileProgress */
|
||
|
|
||
|
type UploadFileProgressProps = {
|
||
|
uploads: UploadFiles;
|
||
|
};
|