mirror of
https://github.com/meshtastic/web.git
synced 2026-03-14 11:58:49 -04:00
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import { useDevice } from "@core/stores/deviceStore.js";
|
|
import { QRDialog } from "@components/Dialog/QRDialog.js";
|
|
import { RebootDialog } from "@components/Dialog/RebootDialog.js";
|
|
import { ShutdownDialog } from "@components/Dialog/ShutdownDialog.js";
|
|
import { ImportDialog } from "@components/Dialog/ImportDialog.js";
|
|
import { DeviceNameDialog } from "./DeviceNameDialog.js";
|
|
|
|
export const DialogManager = (): JSX.Element => {
|
|
const { channels, config, dialog, setDialogOpen } = useDevice();
|
|
return (
|
|
<>
|
|
<QRDialog
|
|
open={dialog.QR}
|
|
onOpenChange={(open) => {
|
|
setDialogOpen("QR", open);
|
|
}}
|
|
channels={channels}
|
|
loraConfig={config.lora}
|
|
/>
|
|
<ImportDialog
|
|
open={dialog.import}
|
|
onOpenChange={(open) => {
|
|
setDialogOpen("import", open);
|
|
}}
|
|
loraConfig={config.lora}
|
|
/>
|
|
<ShutdownDialog
|
|
open={dialog.shutdown}
|
|
onOpenChange={() => {
|
|
setDialogOpen("shutdown", false);
|
|
}}
|
|
/>
|
|
<RebootDialog
|
|
open={dialog.reboot}
|
|
onOpenChange={() => {
|
|
setDialogOpen("reboot", false);
|
|
}}
|
|
/>
|
|
<DeviceNameDialog
|
|
open={dialog.deviceName}
|
|
onOpenChange={(open) => {
|
|
setDialogOpen("deviceName", open);
|
|
}}
|
|
/>
|
|
</>
|
|
);
|
|
};
|