Files
twenty/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverviewFieldWithoutRelation.tsx
T
brendanlaschke 01fe3b673e Datamodel overview show other fields (#6352)
<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>
2024-07-22 16:13:49 +02:00

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>
);
};