-
Notifications
You must be signed in to change notification settings - Fork 11
/
InspectorItem.tsx
44 lines (39 loc) · 988 Bytes
/
InspectorItem.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
import React, { ReactNode } from 'react';
import styled from 'styled-components';
// == styles =======================================================================================
const Label = styled.div`
margin: 0.15rem;
font-size: 0.7rem;
line-height: 1em;
overflow: hidden;
width: calc( 100% - 4.3rem );
text-overflow: ellipsis;
white-space: nowrap;
`;
const Root = styled.div`
display: flex;
justify-content: space-between;
margin: 0.125rem 0;
`;
// == components ===================================================================================
export interface InspectorItemProps {
className?: string;
children?: ReactNode;
name?: string;
description?: string;
}
const InspectorItem = ( {
className,
children,
name,
description
}: InspectorItemProps ): JSX.Element => (
<Root
className={ className }
data-stalker={ description ?? name }
>
<Label>{ name }</Label>
{ children }
</Root>
);
export { InspectorItem };