mirror of
https://github.com/documenso/documenso.git
synced 2026-08-15 02:53:32 +10:00
Swaps the tab row and dropdowns for faceted filter pills (status, sender, period) with a shared reset, and moves URL param handling to nuqs. <img width="2198" height="1674" alt="image" src="https://github.com/user-attachments/assets/6996431c-09c8-45c3-bc30-f0a1e503c941" />
20 lines
736 B
TypeScript
20 lines
736 B
TypeScript
import { ExtendedDocumentStatus } from '@documenso/prisma/types/extended-document-status';
|
|
import { parseAsArrayOf, parseAsInteger, parseAsString, parseAsStringLiteral } from 'nuqs';
|
|
|
|
export const DOCUMENTS_PERIOD_VALUES = ['7d', '14d', '30d'] as const;
|
|
|
|
/**
|
|
* Shared nuqs parsers for the documents page URL state.
|
|
*
|
|
* Used by the documents page and its filter components so every consumer
|
|
* parses and serialises the params identically.
|
|
*/
|
|
export const documentsSearchParams = {
|
|
status: parseAsStringLiteral(Object.values(ExtendedDocumentStatus)),
|
|
period: parseAsStringLiteral(DOCUMENTS_PERIOD_VALUES),
|
|
senderIds: parseAsArrayOf(parseAsInteger),
|
|
page: parseAsInteger,
|
|
perPage: parseAsInteger,
|
|
query: parseAsString,
|
|
};
|