Skip to content

Commit

Permalink
Merge pull request #266 from liam-hq/show-visible-table-count
Browse files Browse the repository at this point in the history
feat: LeftPane now shows the number of tables currently being displayed
  • Loading branch information
junkisai authored Dec 16, 2024
2 parents 8c45a56 + bfcbb3a commit f9382fa
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 f9382fa

Please sign in to comment.