refactor(admin): align admin ui with app design language
- dashboard: card grid replaced by status strip + nav-tile section + list - nav-tile promoted to shared component - stat tiles and usage screen de-carded, sections divided like settings - hub run tournament back to a list row - telemetry link restored in tools list
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ReactNode } from "react";
|
||||
import { Box, Card, Group, Stack, Text, UnstyledButton } from "@mantine/core";
|
||||
import { Box, Group, Stack, Text, UnstyledButton } from "@mantine/core";
|
||||
import Sparkline from "./sparkline";
|
||||
|
||||
interface StatTileProps {
|
||||
@@ -13,12 +13,9 @@ interface StatTileProps {
|
||||
|
||||
export const StatTile = ({ label, value, delta, spark, caption, onClick }: StatTileProps) => {
|
||||
const content = (
|
||||
<Stack gap={4}>
|
||||
<Text size="xs" c="dimmed">
|
||||
{label}
|
||||
</Text>
|
||||
<Stack gap={2}>
|
||||
<Group gap="xs" align="baseline" wrap="nowrap">
|
||||
<Text fz={24} fw={600} lh={1.2}>
|
||||
<Text fz="xl" fw={700} lh={1.2}>
|
||||
{value}
|
||||
</Text>
|
||||
{delta !== undefined && delta !== 0 && (
|
||||
@@ -28,6 +25,9 @@ export const StatTile = ({ label, value, delta, spark, caption, onClick }: StatT
|
||||
</Text>
|
||||
)}
|
||||
</Group>
|
||||
<Text size="xs" c="dimmed">
|
||||
{label}
|
||||
</Text>
|
||||
{caption && <Box>{caption}</Box>}
|
||||
{spark && spark.length > 0 && <Sparkline data={spark} height={28} />}
|
||||
</Stack>
|
||||
@@ -35,19 +35,13 @@ export const StatTile = ({ label, value, delta, spark, caption, onClick }: StatT
|
||||
|
||||
if (onClick) {
|
||||
return (
|
||||
<UnstyledButton onClick={onClick} w="100%">
|
||||
<Card withBorder radius="md" p="md">
|
||||
{content}
|
||||
</Card>
|
||||
<UnstyledButton className="flxn-press" onClick={onClick} w="100%">
|
||||
{content}
|
||||
</UnstyledButton>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Card withBorder radius="md" p="md">
|
||||
{content}
|
||||
</Card>
|
||||
);
|
||||
return content;
|
||||
};
|
||||
|
||||
export default StatTile;
|
||||
|
||||
Reference in New Issue
Block a user