Skip to content

Commit

Permalink
feat: LeftPane now shows the number of tables currently being displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
MH4GF committed Dec 16, 2024
1 parent 009ad4f commit bfcbb3a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions frontend/.changeset/few-socks-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@liam-hq/erd-core": patch
"@liam-hq/cli": patch
---

LeftPane now shows the number of tables currently being displayed
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Table2 } from '@liam-hq/ui'
import { useNodes } from '@xyflow/react'
import type { FC } from 'react'
import { useDBStructureStore } from '../../../../stores'
import styles from './TableCounter.module.css'

export const TableCounter: FC = () => {
const { tables } = useDBStructureStore()
const allCount = Object.keys(tables).length
// TODO: Implement filtering
const visibleCount = allCount
const nodes = useNodes()
const allCount = nodes.length
const visibleCount = nodes.filter((node) => !node.hidden).length

return (
<div className={styles.wrapper}>
Expand Down

0 comments on commit bfcbb3a

Please sign in to comment.