improve profile page

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-05-07 23:27:31 +02:00
parent bc54801ad3
commit ab367cf4db
14 changed files with 85 additions and 127 deletions

View File

@@ -1,14 +1,17 @@
import { useTransition } from 'react';
import { parseAsInteger, useQueryState } from 'nuqs';
export function useCursor() {
const [loading, startTransition] = useTransition();
const [cursor, setCursor] = useQueryState(
'cursor',
parseAsInteger
.withOptions({ shallow: false, history: 'push' })
.withOptions({ shallow: false, history: 'push', startTransition })
.withDefault(0)
);
return {
cursor,
setCursor,
loading,
};
}