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