Files
twenty/front/src/pages/companies/constants/companyShowFieldDefinition.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

103 lines
2.4 KiB
TypeScript

import { FieldDefinition } from '@/ui/data/field/types/FieldDefinition';
import {
FieldBooleanMetadata,
FieldDateMetadata,
FieldMetadata,
FieldNumberMetadata,
FieldRelationMetadata,
FieldTextMetadata,
FieldURLMetadata,
} from '@/ui/data/field/types/FieldMetadata';
import {
IconBrandX,
IconCalendar,
IconLink,
IconMap,
IconPencil,
IconTarget,
IconUserCircle,
IconUsers,
} from '@/ui/display/icon';
import { Entity } from '@/ui/input/relation-picker/types/EntityTypeForSelect';
import { User } from '~/generated/graphql';
export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
{
key: 'domainName',
name: 'Domain name',
Icon: IconLink,
type: 'url',
metadata: {
fieldName: 'domainName',
placeHolder: 'URL',
},
buttonIcon: IconPencil,
} satisfies FieldDefinition<FieldURLMetadata>,
{
key: 'accountOwner',
name: 'Account owner',
Icon: IconUserCircle,
type: 'relation',
metadata: {
fieldName: 'accountOwner',
relationType: Entity.User,
},
entityChipDisplayMapper: (dataObject: User) => {
return {
name: dataObject?.displayName,
pictureUrl: dataObject?.avatarUrl ?? undefined,
avatarType: 'rounded',
};
},
} satisfies FieldDefinition<FieldRelationMetadata>,
{
key: 'employees',
name: 'Employees',
Icon: IconUsers,
type: 'number',
metadata: {
fieldName: 'employees',
placeHolder: 'Employees',
},
} satisfies FieldDefinition<FieldNumberMetadata>,
{
key: 'address',
name: 'Address',
Icon: IconMap,
type: 'text',
metadata: {
fieldName: 'address',
placeHolder: 'Address',
},
} satisfies FieldDefinition<FieldTextMetadata>,
{
key: 'idealCustomerProfile',
name: 'ICP',
Icon: IconTarget,
type: 'boolean',
metadata: {
fieldName: 'idealCustomerProfile',
},
} satisfies FieldDefinition<FieldBooleanMetadata>,
{
key: 'xUrl',
name: 'Twitter',
Icon: IconBrandX,
type: 'url',
metadata: {
fieldName: 'xUrl',
placeHolder: 'X',
},
buttonIcon: IconPencil,
} satisfies FieldDefinition<FieldURLMetadata>,
{
key: 'createdAt',
name: 'Created at',
Icon: IconCalendar,
type: 'date',
metadata: {
fieldName: 'createdAt',
},
} satisfies FieldDefinition<FieldDateMetadata>,
];