update hooks

This commit is contained in:
Jonathan Summers-Muir committed 2025-04-25 18:52:40 +08:00
1 parent 2358f40f9e
commit 0afe169abf
2 files changed
+5 -4

No files matched your search

@@ -1,7 +1,8 @@
import { useCallback, useMemo } from 'react'
import { useTableEditorFiltersSort } from 'hooks/misc/useTableEditorFiltersSort'
import { useSafeTableEditorSnapshot } from './useSafeTableEditorSnapshot'
import { useTableEditorTableStateSnapshot } from 'state/table-editor-table'
import { SELECT_COLUMN_KEY } from 'components/grid/constants'
// Remove dependency on useSaveTableEditorState
@@ -15,7 +16,7 @@ import { SELECT_COLUMN_KEY } from 'components/grid/constants'
*/
export function useTableColumnOrder() {
const { columnOrder, setParams } = useTableEditorFiltersSort()
const snap = useSafeTableEditorSnapshot()
const snap = useTableEditorTableStateSnapshot()
// Read current order directly from Valtio State
const columnOrderMemo = useMemo(() => {
@@ -1,7 +1,7 @@
import { useCallback, useMemo } from 'react'
import { useTableEditorFiltersSort } from 'hooks/misc/useTableEditorFiltersSort'
import { useSafeTableEditorSnapshot } from './useSafeTableEditorSnapshot'
import { useTableEditorTableStateSnapshot } from 'state/table-editor-table'
/**
* Provides state and actions for managing table column visibility.
@@ -12,7 +12,7 @@ import { useSafeTableEditorSnapshot } from './useSafeTableEditorSnapshot'
*/
export function useTableColumnVisibility() {
const { setParams } = useTableEditorFiltersSort() // Only need setParams
const snap = useSafeTableEditorSnapshot()
const snap = useTableEditorTableStateSnapshot()
// Derive hidden columns Set directly from Valtio state
const hiddenColumnsSet = useMemo(() => {