zhou zhou
82 分钟以前 cfe049492f81d2c650a2b17348593edbc5054498
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import React from "react";
import { alpha } from '@mui/material/styles';
import { Box, Grid, Paper, Stack, Typography } from '@mui/material';
 
const pageShellSx = {
    mt: 0.5,
    width: '100%',
};
 
export const AiConsoleLayout = ({ title, subtitle, actions, stats, children }) => (
    <Box sx={pageShellSx}>
        <Paper
            elevation={0}
            sx={{
                borderRadius: 3,
                px: { xs: 2, md: 2.5 },
                py: 2,
                overflow: 'hidden',
                backgroundColor: '#fff',
                border: '1px solid #e6ebf2',
                boxShadow: '0 1px 3px rgba(15, 23, 42, 0.06)',
            }}
        >
            <Stack direction={{ xs: 'column', md: 'row' }} justifyContent="space-between" spacing={2}>
                <Box>
                    <Typography variant="h6" sx={{ fontWeight: 700, letterSpacing: 0.1 }}>
                        {title}
                    </Typography>
                    {subtitle ? (
                        <Typography variant="body2" color="text.secondary" sx={{ mt: 0.5, maxWidth: 760 }}>
                            {subtitle}
                        </Typography>
                    ) : null}
                </Box>
                {actions ? (
                    <Stack direction="row" spacing={1} flexWrap="wrap" justifyContent="flex-end">
                        {actions}
                    </Stack>
                ) : null}
            </Stack>
            {stats?.length ? (
                <Grid container spacing={1.5} sx={{ mt: 1.5 }}>
                    {stats.map((item) => (
                        <Grid item xs={12} sm={6} md={12 / Math.min(stats.length, 4)} key={item.label}>
                            <Box
                                sx={{
                                    minHeight: 76,
                                    px: 1.5,
                                    py: 1.25,
                                    borderRadius: 2,
                                    border: '1px solid #e7ecf3',
                                    backgroundColor: '#fafbfd',
                                }}
                            >
                                <Typography variant="caption" color="text.secondary">
                                    {item.label}
                                </Typography>
                                <Typography variant="h5" sx={{ mt: 0.5, fontWeight: 700, lineHeight: 1.1 }}>
                                    {item.value}
                                </Typography>
                                {item.helper ? (
                                    <Typography variant="caption" color="text.secondary">
                                        {item.helper}
                                    </Typography>
                                ) : null}
                            </Box>
                        </Grid>
                    ))}
                </Grid>
            ) : null}
        </Paper>
        <Box sx={{ mt: 1.5 }}>
            {children}
        </Box>
    </Box>
);
 
export const AiConsolePanel = ({ title, subtitle, action, children, minHeight }) => (
    <Paper
        elevation={0}
        sx={{
            height: '100%',
            minHeight: minHeight || 240,
            borderRadius: 3,
            border: '1px solid #e6ebf2',
            backgroundColor: '#fff',
            boxShadow: '0 1px 3px rgba(15, 23, 42, 0.06)',
            overflow: 'hidden',
        }}
    >
        <Stack
            direction="row"
            justifyContent="space-between"
            alignItems="flex-start"
            spacing={1}
            sx={{
                px: 2,
                py: 1.5,
                borderBottom: '1px solid #e6edf5',
                backgroundColor: alpha('#fafbfc', 1),
            }}
        >
            <Box>
                <Typography variant="subtitle1" sx={{ fontWeight: 700 }}>
                    {title}
                </Typography>
                {subtitle ? (
                    <Typography variant="caption" color="text.secondary" sx={{ display: 'block', mt: 0.5 }}>
                        {subtitle}
                    </Typography>
                ) : null}
            </Box>
            {action}
        </Stack>
        <Box sx={{ p: 1.5 }}>
            {children}
        </Box>
    </Paper>
);
 
export const aiCardSx = (active) => ({
    p: 1.5,
    borderRadius: 2.5,
    border: active ? '1px solid #d7e2ef' : '1px solid #e5eaf0',
    backgroundColor: '#fff',
    boxShadow: active
        ? '0 2px 8px rgba(15, 23, 42, 0.08)'
        : '0 1px 4px rgba(15, 23, 42, 0.04)',
    transition: 'box-shadow 0.18s ease, border-color 0.18s ease',
    '&:hover': {
        boxShadow: '0 3px 10px rgba(15, 23, 42, 0.08)',
    },
});