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
| import React, { useState, useRef, useEffect, useMemo } from "react";
| import {
| RecordContextProvider,
| ReferenceManyField,
| ShowBase,
| SortButton,
| TabbedShowLayout,
| useListContext,
| useRecordContext,
| useShowContext,
| } from 'react-admin';
| import { Link as RouterLink, useLocation } from 'react-router-dom';
| import {
| Box,
| Button,
| Card,
| CardContent,
| List,
| ListItem,
| ListItemAvatar,
| ListItemSecondaryAction,
| ListItemText,
| Stack,
| Typography,
| } from '@mui/material';
| import { formatDistance } from 'date-fns';
|
|
| export const AgvShow = () => {
|
| return (
| <>
| <ShowBase>
| <AgvShowContent />
| </ShowBase>
| </>
| )
| }
|
| const AgvShowContent = (props) => {
| const { record, isPending } = useShowContext();
| if (isPending || !record) return null;
|
| return (
| <>
| <Box mt={2} display="flex">
| <Box flex="1">
| <Card>
| <CardContent>
| <Box display="flex" mb={1}>
| <Typography variant="h5" ml={2} flex="1">
| {record.uuid}
| </Typography>
| </Box>
|
| <TabbedShowLayout
| sx={{
| '& .RaTabbedShowLayout-content': { p: 0 },
| }}
| >
| <TabbedShowLayout.Tab label="Activity">
| </TabbedShowLayout.Tab>
| </TabbedShowLayout>
| </CardContent>
| </Card>
| </Box>
| <AgvShowAside />
| </Box>
| </>
| )
| }
|
| const AgvShowAside = (props) => {
| const { record, isPending } = useShowContext();
|
| return (<>
| <h1>{JSON.stringify(record)}</h1>
| </>)
| }
|
|