Refactor imports across multiple components for consistency and clarity
- Reorganized import statements in various components to ensure consistent ordering and grouping. - Removed unnecessary imports and added missing ones where applicable. - Improved readability and maintainability of the codebase by standardizing import styles.
This commit is contained in:
@@ -3,11 +3,11 @@ import { Typography, Stack, Divider } from "@mui/material";
|
||||
import { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { EnhancedCard } from "./enhanced-card";
|
||||
|
||||
import { useClash } from "@/hooks/use-clash";
|
||||
import { useAppData } from "@/providers/app-data-provider";
|
||||
|
||||
import { EnhancedCard } from "./enhanced-card";
|
||||
|
||||
// 将毫秒转换为时:分:秒格式的函数
|
||||
const formatUptime = (uptimeMs: number) => {
|
||||
const hours = Math.floor(uptimeMs / 3600000);
|
||||
|
||||
@@ -20,11 +20,6 @@ import { ReactNode } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import useSWR from "swr";
|
||||
|
||||
import {
|
||||
EnhancedCanvasTrafficGraph,
|
||||
type EnhancedCanvasTrafficGraphRef,
|
||||
} from "./enhanced-canvas-traffic-graph";
|
||||
|
||||
import { TrafficErrorBoundary } from "@/components/common/traffic-error-boundary";
|
||||
import { useTrafficDataEnhanced } from "@/hooks/use-traffic-monitor";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
@@ -33,6 +28,11 @@ import { useAppData } from "@/providers/app-data-provider";
|
||||
import { isDebugEnabled, gc } from "@/services/cmds";
|
||||
import parseTraffic from "@/utils/parse-traffic";
|
||||
|
||||
import {
|
||||
EnhancedCanvasTrafficGraph,
|
||||
type EnhancedCanvasTrafficGraphRef,
|
||||
} from "./enhanced-canvas-traffic-graph";
|
||||
|
||||
interface StatCardProps {
|
||||
icon: ReactNode;
|
||||
title: string;
|
||||
|
||||
@@ -24,13 +24,13 @@ import { useMemo, useCallback, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
import { EnhancedCard } from "./enhanced-card";
|
||||
|
||||
import { useAppData } from "@/providers/app-data-provider";
|
||||
import { openWebUrl, updateProfile } from "@/services/cmds";
|
||||
import { showNotice } from "@/services/noticeService";
|
||||
import parseTraffic from "@/utils/parse-traffic";
|
||||
|
||||
import { EnhancedCard } from "./enhanced-card";
|
||||
|
||||
// 定义旋转动画
|
||||
const round = keyframes`
|
||||
from { transform: rotate(0deg); }
|
||||
|
||||
@@ -8,10 +8,10 @@ import { Box, Typography, Button, Skeleton, IconButton } from "@mui/material";
|
||||
import { useState, useEffect, useCallback, memo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { EnhancedCard } from "./enhanced-card";
|
||||
|
||||
import { getIpInfo } from "@/services/api";
|
||||
|
||||
import { EnhancedCard } from "./enhanced-card";
|
||||
|
||||
// 定义刷新时间(秒)
|
||||
const IP_REFRESH_SECONDS = 300;
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
IconButton,
|
||||
Tooltip,
|
||||
} from "@mui/material";
|
||||
import { version as appVersion } from "@root/package.json";
|
||||
import { check as checkUpdate } from "@tauri-apps/plugin-updater";
|
||||
import { useLockFn } from "ahooks";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
@@ -22,13 +21,14 @@ import { useTranslation } from "react-i18next";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import useSWR from "swr";
|
||||
|
||||
import { EnhancedCard } from "./enhanced-card";
|
||||
|
||||
import { useSystemState } from "@/hooks/use-system-state";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
import { useServiceInstaller } from "@/hooks/useServiceInstaller";
|
||||
import { getSystemInfo } from "@/services/cmds";
|
||||
import { showNotice } from "@/services/noticeService";
|
||||
import { version as appVersion } from "@root/package.json";
|
||||
|
||||
import { EnhancedCard } from "./enhanced-card";
|
||||
|
||||
export const SystemInfoCard = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -14,8 +14,6 @@ import { nanoid } from "nanoid";
|
||||
import { useEffect, useRef, useMemo, useCallback } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { EnhancedCard } from "./enhanced-card";
|
||||
|
||||
// test icons
|
||||
import apple from "@/assets/image/test/apple.svg?raw";
|
||||
import github from "@/assets/image/test/github.svg?raw";
|
||||
@@ -25,6 +23,8 @@ import { TestItem } from "@/components/test/test-item";
|
||||
import { TestViewer, TestViewerRef } from "@/components/test/test-viewer";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
|
||||
import { EnhancedCard } from "./enhanced-card";
|
||||
|
||||
// 自定义滚动条样式
|
||||
const ScrollBox = styled(Box)(({ theme }) => ({
|
||||
maxHeight: "180px",
|
||||
|
||||
Reference in New Issue
Block a user