-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathProductShow.tsx
78 lines (76 loc) · 2.24 KB
/
ProductShow.tsx
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
import {
Datagrid,
DateField,
EmailField,
ReferenceField,
ReferenceManyCount,
ReferenceManyField,
Show,
Tab,
TabbedShowLayout,
TextField,
} from "react-admin";
import { CustomerAvatar } from "../customers/CustomerAvatar";
import { StatusField } from "../tickets/StatusField";
import { DateField as TicketDateField } from "../tickets/DateField";
import { SubjectField } from "../tickets/SubjectField";
import { FromField } from "../tickets/FromField";
export const ProductShow = () => (
<Show>
<TextField source="model" variant="h5" component="div" m={2} />
<TabbedShowLayout
sx={{
"& .RaTabbedShowLayout-content": {
p: 0,
},
}}
>
<Tab
label="Customers"
count={<ReferenceManyCount reference="customers" target="product_id" />}
>
<ReferenceManyField
label={false}
reference="customers"
target="product_id"
>
<Datagrid rowClick="show">
<CustomerAvatar size="small" />
<TextField source="firstName" />
<TextField source="lastName" />
<EmailField source="email" />
<ReferenceManyCount
label="Tickets"
reference="tickets"
target="customer_id"
/>
<DateField label="Latest message" source="updated_at" showTime />
<TextField source="phone" />
<TextField source="city" />
</Datagrid>
</ReferenceManyField>
</Tab>
<Tab
label="Tickets"
count={<ReferenceManyCount reference="tickets" target="product_id" />}
>
<ReferenceManyField
label={false}
reference="tickets"
target="product_id"
>
<Datagrid rowClick="show">
<ReferenceField source="customer_id" reference="customers" label="">
<CustomerAvatar size="small" />
</ReferenceField>
<ReferenceField source="customer_id" reference="customers" />
<TicketDateField label="Date" source="updated_at" />
<SubjectField />
<FromField />
<StatusField />
</Datagrid>
</ReferenceManyField>
</Tab>
</TabbedShowLayout>
</Show>
);