mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-04 18:29:23 +02:00
25 lines
809 B
TypeScript
25 lines
809 B
TypeScript
import { Dialog, DialogFooter, DialogType, PrimaryButton } from '@fluentui/react';
|
|
import { observer } from "mobx-react-lite";
|
|
import { PropsWithChildren } from 'react';
|
|
import { global } from '../state';
|
|
|
|
export const ErrorDialogProvider = observer((props: PropsWithChildren<{}>) => {
|
|
return (
|
|
<>
|
|
{props.children}
|
|
|
|
<Dialog
|
|
hidden={!global.errorDialogVisible}
|
|
dialogContentProps={{
|
|
type: DialogType.normal,
|
|
title: 'Error',
|
|
subText: global.errorDialogMessage,
|
|
}}
|
|
>
|
|
<DialogFooter>
|
|
<PrimaryButton text="OK" onClick={global.hideErrorDialog} />
|
|
</DialogFooter>
|
|
</Dialog>
|
|
</>
|
|
);
|
|
});
|