Skip to content

Commit

Permalink
feat: Send openRelatedTablesLogEvent when opening related tables on m…
Browse files Browse the repository at this point in the history
…ain area
  • Loading branch information
sasamuku committed Dec 19, 2024
1 parent 8f5baee commit ac55466
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -29,7 +30,10 @@ export const RelatedTables: FC<Props> = ({ table }) => {
}))
})
updateActiveTableName(undefined)
}, [nodes, setNodes])
OpenRelatedTablesLogEvent({
tableId: table.name,
})
}, [nodes, setNodes, table.name])

return (
<div className={styles.wrapper}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ type OpenRelatedTablesLogEvent = {
tableId: string
}

export const OpenRelatedTablesLogEvent = ({ tableId }: OpenRelatedTablesLogEvent) => {
export const OpenRelatedTablesLogEvent = ({
tableId,
}: OpenRelatedTablesLogEvent) => {
pushToDataLayer({
event: 'open_related_tables',
tableId,
Expand Down

0 comments on commit ac55466

Please sign in to comment.