diff --git a/client/package.json b/client/package.json index 71f088909..376671942 100644 --- a/client/package.json +++ b/client/package.json @@ -47,14 +47,6 @@ "vite-plugin-svgr": "^4.2.0", "zod": "4.1.11" }, - "unusedDepencies": { - "@solana/wallet-adapter-base": "0.9.25", - "@solana/wallet-adapter-material-ui": "0.16.35", - "@solana/wallet-adapter-react": "0.15.37", - "@solana/wallet-adapter-react-ui": "0.9.37", - "@solana/wallet-adapter-wallets": "0.19.34", - "@solana/web3.js": "1.98.0" - }, "devDependencies": { "@types/node": "24.5.2", "@types/react": "^18.2.66", diff --git a/client/src/App.jsx b/client/src/App.jsx index 04f0d5b65..d21850ebb 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -9,7 +9,6 @@ import { CssBaseline, GlobalStyles } from "@mui/material"; import { logger } from "./Utils/Logger"; // Import the logger import { networkService } from "./main"; import { Routes } from "./Routes"; -import WalletProvider from "./Components/WalletProvider"; import AppLayout from "@/Components/v1/Layouts/AppLayout"; function App() { @@ -24,16 +23,12 @@ function App() { }, []); return ( - /* Extract Themeprovider, baseline and global styles to Styles */ - - - - - - - - + + + + + ); } diff --git a/client/src/Components/v2/DesignElements/StatBox.tsx b/client/src/Components/v2/DesignElements/StatBox.tsx index e5d4dcef5..3450444b2 100644 --- a/client/src/Components/v2/DesignElements/StatBox.tsx +++ b/client/src/Components/v2/DesignElements/StatBox.tsx @@ -1,6 +1,5 @@ import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import Box from "@mui/material/Box"; import { useTheme } from "@mui/material/styles"; import { useMediaQuery } from "@mui/material"; import type { PaletteKey } from "@/Utils/Theme/v2/theme"; diff --git a/client/src/Components/v2/DesignElements/StatusLabel.tsx b/client/src/Components/v2/DesignElements/StatusLabel.tsx new file mode 100644 index 000000000..69b788e96 --- /dev/null +++ b/client/src/Components/v2/DesignElements/StatusLabel.tsx @@ -0,0 +1,35 @@ +import Box from "@mui/material/Box"; +import { BaseBox } from "@/Components/v2/DesignElements"; +import type { MonitorStatus } from "@/Types/Monitor"; + +import { getStatusPalette } from "@/Utils/MonitorUtils"; +import { useTheme } from "@mui/material/styles"; + +export const StatusLabel = ({ status }: { status: MonitorStatus }) => { + const theme = useTheme(); + const palette = getStatusPalette(status); + const transformedText = status.charAt(0).toUpperCase() + status.slice(1).toLowerCase(); + + return ( + + + {transformedText} + + ); +}; diff --git a/client/src/Components/v2/DesignElements/Table.tsx b/client/src/Components/v2/DesignElements/Table.tsx index 6296d260c..58cc6aed1 100644 --- a/client/src/Components/v2/DesignElements/Table.tsx +++ b/client/src/Components/v2/DesignElements/Table.tsx @@ -5,7 +5,19 @@ import TableCell from "@mui/material/TableCell"; import TableContainer from "@mui/material/TableContainer"; import TableHead from "@mui/material/TableHead"; import TableRow from "@mui/material/TableRow"; + +import IconButton from "@mui/material/IconButton"; +import LastPageIcon from "@mui/icons-material/LastPage"; +import FirstPageIcon from "@mui/icons-material/FirstPage"; +import KeyboardArrowLeft from "@mui/icons-material/KeyboardArrowLeft"; +import KeyboardArrowRight from "@mui/icons-material/KeyboardArrowRight"; + +import Box from "@mui/material/Box"; +import TablePagination from "@mui/material/TablePagination"; +import type { TablePaginationProps } from "@mui/material/TablePagination"; + import { useTheme } from "@mui/material/styles"; +import { useMediaQuery } from "@mui/material"; export type Header = { id: number | string; content: React.ReactNode; @@ -87,3 +99,109 @@ export function DataTable ); } + +interface TablePaginationActionsProps { + count: number; + page: number; + rowsPerPage: number; + onPageChange: (event: React.MouseEvent, newPage: number) => void; +} + +function TablePaginationActions(props: TablePaginationActionsProps) { + const theme = useTheme(); + const { count, page, rowsPerPage, onPageChange } = props; + + const handleFirstPageButtonClick = (event: React.MouseEvent) => { + onPageChange(event, 0); + }; + + const handleBackButtonClick = (event: React.MouseEvent) => { + onPageChange(event, page - 1); + }; + + const handleNextButtonClick = (event: React.MouseEvent) => { + onPageChange(event, page + 1); + }; + + const handleLastPageButtonClick = (event: React.MouseEvent) => { + onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1)); + }; + + return ( + + + {theme.direction === "rtl" ? : } + + + {theme.direction === "rtl" ? : } + + = Math.ceil(count / rowsPerPage) - 1} + aria-label="next page" + > + {theme.direction === "rtl" ? : } + + = Math.ceil(count / rowsPerPage) - 1} + aria-label="last page" + > + {theme.direction === "rtl" ? : } + + + ); +} + +export const Pagination: React.FC = ({ ...props }) => { + const isSmall = useMediaQuery((theme: any) => theme.breakpoints.down("sm")); + const theme = useTheme(); + return ( + + ); +}; diff --git a/client/src/Components/v2/DesignElements/index.tsx b/client/src/Components/v2/DesignElements/index.tsx index 359982c42..6ba0a19ac 100644 --- a/client/src/Components/v2/DesignElements/index.tsx +++ b/client/src/Components/v2/DesignElements/index.tsx @@ -1,6 +1,7 @@ export { SplitBox as HorizontalSplitBox, ConfigBox } from "./SplitBox"; export { BasePage } from "./BasePage"; export { BGBox, UpStatusBox, DownStatusBox, PausedStatusBox } from "./StatusBox"; -export { DataTable as Table } from "./Table"; +export { DataTable as Table, Pagination } from "./Table"; export { GradientBox, StatBox } from "./StatBox"; export { BaseBox } from "./BaseBox"; +export { StatusLabel } from "./StatusLabel"; diff --git a/client/src/Components/v2/Inputs/Button.tsx b/client/src/Components/v2/Inputs/Button.tsx index bca6cee34..2f28e8eda 100644 --- a/client/src/Components/v2/Inputs/Button.tsx +++ b/client/src/Components/v2/Inputs/Button.tsx @@ -1,10 +1,9 @@ import Button from "@mui/material/Button"; import type { ButtonProps } from "@mui/material/Button"; -export const ButtonInput: React.FC = ({ filled, sx, ...props }) => { +export const ButtonInput: React.FC = ({ sx, ...props }) => { return (