https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=36235-120877 Did not do the file manager part. A Function is defined using one unique file at the moment Feature protected by featureFlag `IS_FUNCTION_SETTINGS_ENABLED` ## Demo https://github.com/user-attachments/assets/0acb8291-47b4-4521-a6fa-a88b9198609b
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import styled from '@emotion/styled';
|
|
import { TableRow } from '@/ui/layout/table/components/TableRow';
|
|
import { ServerlessFunction } from '~/generated-metadata/graphql';
|
|
import { TableCell } from '@/ui/layout/table/components/TableCell';
|
|
import { IconChevronRight } from 'twenty-ui';
|
|
import { useTheme } from '@emotion/react';
|
|
|
|
export const StyledApisFieldTableRow = styled(TableRow)`
|
|
grid-template-columns: 312px 132px 68px;
|
|
`;
|
|
|
|
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 StyledIconChevronRight = styled(IconChevronRight)`
|
|
color: ${({ theme }) => theme.font.color.tertiary};
|
|
`;
|
|
|
|
export const SettingsServerlessFunctionsFieldItemTableRow = ({
|
|
serverlessFunction,
|
|
to,
|
|
}: {
|
|
serverlessFunction: ServerlessFunction;
|
|
to: string;
|
|
}) => {
|
|
const theme = useTheme();
|
|
return (
|
|
<StyledApisFieldTableRow to={to}>
|
|
<StyledNameTableCell>{serverlessFunction.name}</StyledNameTableCell>
|
|
<StyledNameTableCell>{serverlessFunction.runtime}</StyledNameTableCell>
|
|
<StyledIconTableCell>
|
|
<StyledIconChevronRight
|
|
size={theme.icon.size.md}
|
|
stroke={theme.icon.stroke.sm}
|
|
/>
|
|
</StyledIconTableCell>
|
|
</StyledApisFieldTableRow>
|
|
);
|
|
};
|