diff --git a/apps/nestjs-backend/src/types/i18n.generated.ts b/apps/nestjs-backend/src/types/i18n.generated.ts index b318a8bb2..7182fab99 100644 --- a/apps/nestjs-backend/src/types/i18n.generated.ts +++ b/apps/nestjs-backend/src/types/i18n.generated.ts @@ -2231,6 +2231,7 @@ export type I18nTranslations = { "databaseConnectionUnavailable": string; "gatewayTimeout": string; "unknownErrorCode": string; + "networkError": string; "requestTimeout": string; "failedDependency": string; "automationNodeParseError": string; diff --git a/packages/sdk/src/components/filter/filter-with-table/FilterWithTable.tsx b/packages/sdk/src/components/filter/filter-with-table/FilterWithTable.tsx index b8720e785..627e99e3a 100644 --- a/packages/sdk/src/components/filter/filter-with-table/FilterWithTable.tsx +++ b/packages/sdk/src/components/filter/filter-with-table/FilterWithTable.tsx @@ -1,6 +1,6 @@ import type { IFilter } from '@teable/core'; import { FieldType } from '@teable/core'; -import type { ComponentProps } from 'react'; +import { useCallback, useMemo, type ComponentProps } from 'react'; import type { IFieldInstance } from '../../../model'; import type { IViewFilterLinkContext } from '../view-filter'; import { BaseViewFilter, FieldValue } from '../view-filter'; @@ -47,19 +47,26 @@ const FilterLink = (props: IFilterLinkProps) => { export const FilterWithTable = (props: IFilterWithTableProps) => { const { fields, value, context, onChange, referenceSource } = props; - const CustomValueComponent = (valueProps: ICustomerValueComponentProps) => { - const components = { + const components = useMemo( + () => ({ [FieldType.Link]: FilterLink, - }; - return ( - - ); - }; + }), + [] + ); + + const CustomValueComponent = useCallback( + (valueProps: ICustomerValueComponentProps) => { + return ( + + ); + }, + [components, referenceSource] + ); return (