mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-10-30 14:49:14 +00:00
42 lines
760 B
TypeScript
42 lines
760 B
TypeScript
import styled from '@emotion/styled';
|
|
|
|
/**
|
|
* Used in new inbox
|
|
* Renders the project badge and short name
|
|
*/
|
|
|
|
type Props = {
|
|
shortId: string;
|
|
avatar?: React.ReactNode;
|
|
};
|
|
|
|
function ShortId({shortId, avatar}: Props) {
|
|
return (
|
|
<Wrapper>
|
|
<AvatarWrapper>{avatar}</AvatarWrapper>
|
|
<IdWrapper>{shortId}</IdWrapper>
|
|
</Wrapper>
|
|
);
|
|
}
|
|
|
|
export default ShortId;
|
|
|
|
const Wrapper = styled('div')`
|
|
display: flex;
|
|
align-items: center;
|
|
white-space: nowrap;
|
|
text-overflow: ellipsis;
|
|
font-size: ${p => p.theme.fontSizeExtraSmall};
|
|
`;
|
|
const AvatarWrapper = styled('div')`
|
|
margin-right: 3px;
|
|
flex-shrink: 0;
|
|
`;
|
|
|
|
const IdWrapper = styled('div')`
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
margin-top: 1px;
|
|
`;
|