mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 11:33:02 +00:00
feat(kgm): kgm v5 (aka. kgg) support
This commit is contained in:
@@ -18,11 +18,19 @@ export interface ImportSecretModalProps {
|
||||
children: React.ReactNode;
|
||||
show: boolean;
|
||||
onClose: () => void;
|
||||
onImport: (file: File) => void;
|
||||
onImport: (file: File) => void|Promise<void>;
|
||||
}
|
||||
|
||||
export function ImportSecretModal({ clientName, children, show, onClose, onImport }: ImportSecretModalProps) {
|
||||
const handleFileReceived = (files: File[]) => onImport(files[0]);
|
||||
const handleFileReceived = (files: File[]) => {
|
||||
const promise = onImport(files[0]);
|
||||
if (promise instanceof Promise) {
|
||||
promise.catch(err => {
|
||||
console.error('could not import: ', err);
|
||||
});
|
||||
}
|
||||
return promise;
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal isOpen={show} onClose={onClose} closeOnOverlayClick={false} scrollBehavior="inside" size="xl">
|
||||
|
||||
Reference in New Issue
Block a user