added type for statusFilter

This commit is contained in:
Subham Ray
2023-04-24 19:37:41 +05:30
parent dc6217b14e
commit 6d30a486ab

View File

@ -27,7 +27,13 @@ const DocumentsPage: NextPageWithLayout = (props: any) => {
const [filteredDocuments, setFilteredDocuments] = useState([]); const [filteredDocuments, setFilteredDocuments] = useState([]);
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
const statusFilters = [
type statusFilterType = {
label: string;
value: DocumentStatus | "ALL";
};
const statusFilters: statusFilterType[] = [
{ label: "All", value: "ALL" }, { label: "All", value: "ALL" },
{ label: "Draft", value: "DRAFT" }, { label: "Draft", value: "DRAFT" },
{ label: "Waiting for others", value: "PENDING" }, { label: "Waiting for others", value: "PENDING" },
@ -83,7 +89,7 @@ const DocumentsPage: NextPageWithLayout = (props: any) => {
return filteredDocuments; return filteredDocuments;
} }
function handleSetSelectedStatusFilter(status: any) { function handleSetSelectedStatusFilter(status: statusFilterType) {
router.replace( router.replace(
{ {
pathname: router.pathname, pathname: router.pathname,