Files
twenty/front/src/modules/settings/objects/components/ObjectFieldItemTableRow.tsx
Charles Bochet 258685467b Refactor UI folder (#2016)
* Added Overview page

* Revised Getting Started page

* Minor revision

* Edited readme, minor modifications to docs

* Removed sweep.yaml, .devcontainer, .ergomake

* Moved security.md to .github, added contributing.md

* changes as per code review

* updated contributing.md

* fixed broken links & added missing links in doc, improved structure

* fixed link in wsl setup

* fixed server link, added https cloning in yarn-setup

* removed package-lock.json

* added doc card, admonitions

* removed underline from nav buttons

* refactoring modules/ui

* refactoring modules/ui

* Change folder case

* Fix theme location

* Fix case 2

* Fix storybook

---------

Co-authored-by: Nimra Ahmed <nimra1408@gmail.com>
Co-authored-by: Nimra Ahmed <50912134+nimraahmed@users.noreply.github.com>
2023-10-14 00:04:29 +02:00

58 lines
1.6 KiB
TypeScript

import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { IconDotsVertical } from '@/ui/display/icon';
import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { ObjectFieldItem } from '../types/ObjectFieldItem';
import { ObjectFieldDataType } from './ObjectFieldDataType';
export const StyledObjectFieldTableRow = styled(TableRow)`
grid-template-columns: 180px 148px 148px 36px;
`;
const StyledNameTableCell = styled(TableCell)`
color: ${({ theme }) => theme.font.color.primary};
gap: ${({ theme }) => theme.spacing(2)};
`;
const StyledIconTableCell = styled(TableCell)`
justify-content: center;
padding-right: ${({ theme }) => theme.spacing(1)};
`;
const StyledIconDotsVertical = styled(IconDotsVertical)`
color: ${({ theme }) => theme.font.color.tertiary};
`;
export const ObjectFieldItemTableRow = ({
fieldItem,
}: {
fieldItem: ObjectFieldItem;
}) => {
const theme = useTheme();
return (
<StyledObjectFieldTableRow>
<StyledNameTableCell>
<fieldItem.Icon size={theme.icon.size.md} />
{fieldItem.name}
</StyledNameTableCell>
<TableCell>
{fieldItem.type === 'standard' ? 'Standard' : 'Custom'}
</TableCell>
<TableCell>
<ObjectFieldDataType value={fieldItem.dataType} />
</TableCell>
<StyledIconTableCell>
<StyledIconDotsVertical
size={theme.icon.size.md}
stroke={theme.icon.stroke.sm}
/>
</StyledIconTableCell>
</StyledObjectFieldTableRow>
);
};