2023-08-10 15:56:36 -07:00
|
|
|
import * as React from "react";
|
|
|
|
import { Box } from "@chakra-ui/react";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Metadata is a UI component for showing metadata about something, as labels
|
|
|
|
* and their values.
|
|
|
|
*/
|
|
|
|
function Metadata({ children, ...props }) {
|
2024-09-09 16:10:45 -07:00
|
|
|
return (
|
|
|
|
<Box
|
|
|
|
as="dl"
|
|
|
|
display="grid"
|
|
|
|
gridTemplateColumns="max-content auto"
|
|
|
|
gridRowGap="1"
|
|
|
|
gridColumnGap="2"
|
|
|
|
{...props}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</Box>
|
|
|
|
);
|
2023-08-10 15:56:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function MetadataLabel({ children, ...props }) {
|
2024-09-09 16:10:45 -07:00
|
|
|
return (
|
|
|
|
<Box as="dt" gridColumn="1" fontWeight="bold" {...props}>
|
|
|
|
{children}
|
|
|
|
</Box>
|
|
|
|
);
|
2023-08-10 15:56:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function MetadataValue({ children, ...props }) {
|
2024-09-09 16:10:45 -07:00
|
|
|
return (
|
|
|
|
<Box as="dd" gridColumn="2" {...props}>
|
|
|
|
{children}
|
|
|
|
</Box>
|
|
|
|
);
|
2023-08-10 15:56:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export default Metadata;
|
|
|
|
export { MetadataLabel, MetadataValue };
|