import { FIND_ALL_APPLICATION_REGISTRATIONS } from '@/settings/admin-panel/apps/graphql/queries/findAllApplicationRegistrations'; import { Table } from '@/ui/layout/table/components/Table'; import { TableBody } from '@/ui/layout/table/components/TableBody'; import { TableCell } from '@/ui/layout/table/components/TableCell'; import { TableHeader } from '@/ui/layout/table/components/TableHeader'; import { TableRow } from '@/ui/layout/table/components/TableRow'; import { useQuery } from '@apollo/client'; import { styled } from '@linaria/react'; import { t } from '@lingui/core/macro'; import { useState } from 'react'; import { getSettingsPath } from 'twenty-shared/utils'; import { SettingsPath } from 'twenty-shared/types'; import { H2Title, Status } from 'twenty-ui/display'; import { SearchInput } from 'twenty-ui/input'; import { Section } from 'twenty-ui/layout'; import { UndecoratedLink } from 'twenty-ui/navigation'; import { themeCssVariables } from 'twenty-ui/theme-constants'; import { type ApplicationRegistrationFragmentFragment } from '~/generated-metadata/graphql'; const StyledTableContainer = styled.div` margin-top: ${themeCssVariables.spacing[3]}; `; const StyledTableHeaderRowContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[2]}; `; const TABLE_GRID = '1fr 1fr 100px 80px'; export const SettingsAdminApps = () => { const [searchQuery, setSearchQuery] = useState(''); const { data } = useQuery(FIND_ALL_APPLICATION_REGISTRATIONS); const registrations: ApplicationRegistrationFragmentFragment[] = data?.findAllApplicationRegistrations ?? []; const filtered = searchQuery.trim().length === 0 ? registrations : registrations.filter((registration) => { const query = searchQuery.toLowerCase(); return ( registration.name.toLowerCase().includes(query) || (registration.sourcePackage ?? '').toLowerCase().includes(query) || registration.universalIdentifier.toLowerCase().includes(query) ); }); return (
{t`Name`} {t`Source`} {t`Listed`} {t`Featured`} {filtered.map((registration) => ( {registration.name} {registration.sourcePackage ?? registration.sourceType} ))}
); };