diff --git a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/TableNode/TableDetail/RelatedTables/RelatedTables.tsx b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/TableNode/TableDetail/RelatedTables/RelatedTables.tsx index 1ba1a0f3..b4da6d9e 100644 --- a/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/TableNode/TableDetail/RelatedTables/RelatedTables.tsx +++ b/frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/TableNode/TableDetail/RelatedTables/RelatedTables.tsx @@ -1,4 +1,5 @@ import { convertDBStructureToNodes } from '@/components/ERDRenderer/convertDBStructureToNodes' +import { OpenRelatedTablesLogEvent } from '@/features/gtm/utils' import { updateActiveTableName, useDBStructureStore } from '@/stores' import type { Table } from '@liam-hq/db-structure' import { GotoIcon, IconButton } from '@liam-hq/ui' @@ -29,7 +30,10 @@ export const RelatedTables: FC = ({ table }) => { })) }) updateActiveTableName(undefined) - }, [nodes, setNodes]) + OpenRelatedTablesLogEvent({ + tableId: table.name, + }) + }, [nodes, setNodes, table.name]) return (
diff --git a/frontend/packages/erd-core/src/features/gtm/utils/openRelatedTablesLogEvent.ts b/frontend/packages/erd-core/src/features/gtm/utils/openRelatedTablesLogEvent.ts index 7fbed724..3c21e19c 100644 --- a/frontend/packages/erd-core/src/features/gtm/utils/openRelatedTablesLogEvent.ts +++ b/frontend/packages/erd-core/src/features/gtm/utils/openRelatedTablesLogEvent.ts @@ -4,7 +4,9 @@ type OpenRelatedTablesLogEvent = { tableId: string } -export const OpenRelatedTablesLogEvent = ({ tableId }: OpenRelatedTablesLogEvent) => { +export const OpenRelatedTablesLogEvent = ({ + tableId, +}: OpenRelatedTablesLogEvent) => { pushToDataLayer({ event: 'open_related_tables', tableId,