01fe3b673e
<img width="638" alt="Bildschirmfoto 2024-07-19 um 23 49 00" src="https://github.com/user-attachments/assets/57b600c4-d985-4e4c-afc0-e0c6dd5bc9f6"> --------- Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
39 lines
932 B
TypeScript
39 lines
932 B
TypeScript
import { useTheme } from '@emotion/react';
|
|
import styled from '@emotion/styled';
|
|
import { useIcons } from 'twenty-ui';
|
|
|
|
import { FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
|
|
|
|
type ObjectFieldRowWithoutRelationProps = {
|
|
field: FieldMetadataItem;
|
|
};
|
|
|
|
const StyledRow = styled.div`
|
|
align-items: center;
|
|
display: flex;
|
|
gap: ${({ theme }) => theme.spacing(2)};
|
|
position: relative;
|
|
width: 100%;
|
|
padding: 0 ${({ theme }) => theme.spacing(2)};
|
|
`;
|
|
|
|
const StyledFieldName = styled.div`
|
|
color: ${({ theme }) => theme.font.color.primary};
|
|
`;
|
|
|
|
export const ObjectFieldRowWithoutRelation = ({
|
|
field,
|
|
}: ObjectFieldRowWithoutRelationProps) => {
|
|
const { getIcon } = useIcons();
|
|
const theme = useTheme();
|
|
|
|
const Icon = getIcon(field?.icon);
|
|
|
|
return (
|
|
<StyledRow>
|
|
{Icon && <Icon size={theme.icon.size.md} />}
|
|
<StyledFieldName>{field.label}</StyledFieldName>
|
|
</StyledRow>
|
|
);
|
|
};
|