ente/src/components/ExportModal.tsx

30 lines
807 B
TypeScript
Raw Normal View History

2021-07-06 09:20:05 +00:00
import React, { useState } from 'react';
2021-07-06 11:23:13 +00:00
import ExportFinished from './ExportFinished';
2021-07-06 09:20:05 +00:00
import ExportInit from './ExportInit';
import ExportInProgress from './ExportInProgress';
enum ExportState {
INIT,
INPROGRESS,
FINISHED
}
export default function ExportModal(props) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2021-07-06 11:23:13 +00:00
const [exportState, setExportState] = useState(ExportState.FINISHED);
2021-07-06 09:20:05 +00:00
switch (exportState) {
case ExportState.INIT:
return (
<ExportInit {...props} />
);
case ExportState.INPROGRESS:
return (
<ExportInProgress {...props} />
);
2021-07-06 11:23:13 +00:00
case ExportState.FINISHED:
return (
<ExportFinished {...props} />
);
2021-07-06 09:20:05 +00:00
}
}