import styled from '@emotion/styled';
import {space} from 'sentry/styles/space';
function ObjectView({obj}: {obj: object}) {
if (Array.isArray(obj)) {
return (
{obj.map((x, i) => (
))}
);
}
return (
{Object.keys(obj).map(key => (
{key}:
))}
);
}
export function GeneralSpanDetailsValue({value}: {value: any}) {
if (typeof value === 'string') {
return {value};
}
if (typeof value === 'object') {
if (value === null) {
return null;
}
return ;
}
return {JSON.stringify(value, null, 4)};
}
const ListContainer = styled('ul')`
display: flex;
flex-direction: column;
gap: ${space(1)};
padding: 0;
margin-left: ${space(1)};
list-style-type: '-';
flex-grow: 1;
flex-basis: full;
`;
const ObjectContainer = styled('div')`
display: flex;
flex-direction: column;
gap: ${space(1)};
margin-left: ${space(1)};
flex-grow: 1;
flex-basis: full;
`;