#
luxiaotao1123
2024-09-29 55a1c64758c9e44b1dd96ec9f53124355b7304ce
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
import { useState } from 'react';
import {
    Form,
    ReferenceField,
    useNotify,
    useResourceContext,
    useTranslate,
} from 'react-admin';
import {
    Box,
    Button,
    Stack,
    Tooltip,
    Typography,
    Avatar,
} from '@mui/material';
import { format } from 'date-fns';
import { blueGrey } from '@mui/material/colors';
 
export const Action = ({ data }) => {
    const notify = useNotify();
    const translate = useTranslate();
 
    const [isHover, setHover] = useState(false);
 
    return (
        <Box
            onMouseEnter={() => setHover(true)}
            onMouseLeave={() => setHover(false)}
            pb={1}
        >
            <Stack direction="row" spacing={1} alignItems="center" width="100%">
                <Avatar
                    sx={{
                        width: 30,
                        height: 30,
                        bgcolor: blueGrey[500],
                    }}
                >
                    {data.priority}
                </Avatar>
                <Typography color="text.secondary" variant="body2">
                    {data.name}
                </Typography>
                <Box flex={1}></Box>
                <Typography
                    color="textSecondary"
                    variant="body2"
                    component="span"
                >
                    {format(data.ioTime, 'yyyy-MM-dd HH:mm:ss') || '-'}
                </Typography>
            </Stack>
            <Stack
                sx={{
                    paddingTop: '0.5em',
                    display: 'flex',
                    '& p:empty': {
                        minHeight: '0.75em',
                    },
                }}
            >
                {/* {note.text
                    ?.split('\n')
                    .map((paragraph: string, index: number) => (
                        <Typography
                            component="p"
                            variant="body2"
                            lineHeight={1.5}
                            margin={0}
                            key={index}
                        >
                            {paragraph}
                        </Typography>
                    ))}
 
                {note.attachments && <NoteAttachments note={note} />} */}
            </Stack>
        </Box>
    );
};