Files
clash-verge-rev/src/pages/proxy.tsx
T

29 lines
792 B
TypeScript
Raw Normal View History

2021-12-20 01:29:49 +08:00
import useSWR from "swr";
2021-12-22 02:11:31 +08:00
import { Box, List, Paper, Typography } from "@mui/material";
import services from "../services";
import ProxyGroup from "../components/proxy-group";
2021-12-08 23:36:34 +08:00
const ProxyPage = () => {
2021-12-20 01:29:49 +08:00
const { data } = useSWR("getProxies", services.getProxies);
const { groups = [] } = data ?? {};
return (
<Box sx={{ width: 0.9, maxWidth: "850px", mx: "auto", mb: 2 }}>
<Typography variant="h4" component="h1" sx={{ py: 2 }}>
Proxy Groups
</Typography>
2021-12-12 01:02:14 +08:00
{groups.length > 0 && (
2021-12-22 02:11:31 +08:00
<Paper sx={{ borderRadius: 1, boxShadow: 2 }}>
<List>
{groups.map((group) => (
<ProxyGroup key={group.name} group={group} />
))}
</List>
</Paper>
2021-12-12 01:02:14 +08:00
)}
</Box>
);
2021-12-08 23:36:34 +08:00
};
export default ProxyPage;