initial commit

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-03-23 08:46:51 +01:00
commit 4608494a3f
130 changed files with 40361 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import { useState, useCallback } from 'react'
export default function useTableSort(defaultSort = 'id') {
const [sort, setSort] = useState(defaultSort)
const [order, setOrder] = useState<'asc' | 'desc'>('desc')
const handleSort = useCallback((column: string) => {
setSort(prev => {
if (prev === column) {
setOrder(o => (o === 'asc' ? 'desc' : 'asc'))
return column
}
setOrder('desc')
return column
})
}, [])
return { sort, order, handleSort, activeSort: sort }
}