|
1
|
import { ArrowUpRightOnBox } from "@medusajs/icons" |
|
2
|
import { HttpTypes } from "@medusajs/types" |
|
3
|
import { Badge, Container, Heading, IconButton } from "@medusajs/ui" |
|
4
|
import { Link } from "react-router-dom" |
|
5
|
|
|
6
|
interface MetadataSectionProps { |
|
7
|
order: HttpTypes.AdminOrder |
|
8
|
} |
|
9
|
|
|
10
|
export const MetadataSection = ({ order }: MetadataSectionProps) => { |
|
11
|
return ( |
|
12
|
<Container className="flex items-center justify-between"> |
|
13
|
<div className="flex items-center gap-x-2"> |
|
14
|
<Heading level="h2">Metadata</Heading> |
|
15
|
<Badge size="2xsmall" rounded="full"> |
|
16
|
{Object.keys(order.metadata || {}).length} keys |
|
17
|
</Badge> |
|
18
|
</div> |
|
19
|
<IconButton |
|
20
|
variant="transparent" |
|
21
|
size="small" |
|
22
|
className="text-ui-fg-muted hover:text-ui-fg-subtle" |
|
23
|
asChild |
|
24
|
> |
|
25
|
<Link to="metadata"> |
|
26
|
<ArrowUpRightOnBox /> |
|
27
|
</Link> |
|
28
|
</IconButton> |
|
29
|
</Container> |
|
30
|
) |
|
31
|
} |