refactor: notification system
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { forwardRef, useEffect, useImperativeHandle, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { BaseDialog, DialogRef, Notice } from "@/components/base";
|
||||
import { BaseDialog, DialogRef } from "@/components/base";
|
||||
import { getNetworkInterfacesInfo } from "@/services/cmds";
|
||||
import { alpha, Box, Button, Chip, IconButton } from "@mui/material";
|
||||
import { ContentCopyRounded } from "@mui/icons-material";
|
||||
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
|
||||
import { showNotice } from "@/services/noticeService";
|
||||
|
||||
export const NetworkInterfaceViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
const { t } = useTranslation();
|
||||
@@ -128,7 +129,7 @@ const AddressDisplay = (props: { label: string; content: string }) => {
|
||||
size="small"
|
||||
onClick={async () => {
|
||||
await writeText(props.content);
|
||||
Notice.success(t("Copy Success"));
|
||||
showNotice('success', t("Copy Success"));
|
||||
}}
|
||||
>
|
||||
<ContentCopyRounded sx={{ fontSize: "18px" }} />
|
||||
|
||||
Reference in New Issue
Block a user