import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/components/FormTextFieldInput';
import { SettingsDatabaseEventsForm } from '@/settings/components/SettingsDatabaseEventsForm';
import { Table } from '@/ui/layout/table/components/Table';
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import styled from '@emotion/styled';
import { useLingui } from '@lingui/react/macro';
import { H2Title } from 'twenty-ui/display';
import { Section } from 'twenty-ui/layout';
import { type LogicFunction } from '~/generated/graphql';
export const StyledRouteTriggerTableRow = styled(TableRow)`
grid-template-columns: 1fr 120px 120px;
`;
// TODO: @Charles put back with new sources
// const StyledTableCell = styled(TableCell)`
// color: ${({ theme }) => theme.font.color.tertiary};
// gap: ${({ theme }) => theme.spacing(2)};
// min-width: 0;
// overflow: hidden;
// `;
const StyledRouteTriggerTableHeaderRow = styled(StyledRouteTriggerTableRow)`
margin-bottom: ${({ theme }) => theme.spacing(2)};
`;
const StyledEmptyState = styled.div`
align-items: center;
color: ${({ theme }) => theme.font.color.tertiary};
display: flex;
font-size: ${({ theme }) => theme.font.size.md};
height: 160px;
justify-content: center;
text-align: center;
`;
export const SettingsLogicFunctionTriggersTab = ({
logicFunction: _logicFunction,
}: {
logicFunction: LogicFunction;
}) => {
const { t } = useLingui();
const cronTriggers: [] = [];
const routeTriggers: [] = [];
const databaseEvents: [] = [];
const hasNoTriggers =
databaseEvents.length === 0 &&
cronTriggers.length === 0 &&
routeTriggers.length === 0;
if (hasNoTriggers) {
return (
{t`No triggers configured for this function.`}
);
}
return (
<>
{databaseEvents.length > 0 && (
)}
{cronTriggers.length > 0 && (
{cronTriggers.map((cronTrigger, index) => (
{}}
readonly
defaultValue={cronTrigger}
/>
))}
)}
{routeTriggers.length > 0 && (
{t`Path`}
{t`Method`}
{t`Auth Required`}
{routeTriggers.map((_, _index) => (
<>>
//
//
//
//
// {routeTrigger.httpMethod}
//
//
//
//
))}
)}
>
);
};