add decks slice

This commit is contained in:
2023-10-08 12:58:55 +02:00
parent 33f3fc6137
commit 575b14c9b4
4 changed files with 69 additions and 1 deletions

View File

@@ -7,9 +7,14 @@ import { DecksTable } from '@/components/decks/decks-table.tsx'
import { Pagination } from '@/components/ui/pagination'
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs'
import { useGetDecksQuery } from '@/services/decks'
import { selectDecksCurrentPage } from '@/services/decks/decks.selectors.ts'
import { decksSlice } from '@/services/decks/decks.slice.ts'
import { useAppDispatch, useAppSelector } from '@/services/store.ts'
export const DecksPage = () => {
const [currentPage, setCurrentPage] = useState(1)
const dispatch = useAppDispatch()
const currentPage = useAppSelector(selectDecksCurrentPage)
const setCurrentPage = (page: number) => dispatch(decksSlice.actions.setCurrentPage(page))
const { data: decks } = useGetDecksQuery()
const [activeTab, setActiveTab] = useState('my')