Skip to content

Commit

Permalink
Merge pull request #160 from AkshataKatwal16/page-issue
Browse files Browse the repository at this point in the history
Issue feat:Fix build issue
  • Loading branch information
itsvick authored Dec 31, 2024
2 parents 421c696 + 8c5ae8f commit c981bae
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 34 deletions.
4 changes: 3 additions & 1 deletion src/components/SearchBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
getPrimaryCategory,
} from "@/services/ContentService";
import { SortOptions, StatusOptions } from "@/utils/app.constant";
import router from "next/router";
import { useRouter } from "next/router";

export interface SearchBarProps {
onSearch: (value: string) => void;
Expand Down Expand Up @@ -52,6 +52,8 @@ const SearchBox: React.FC<SearchBarProps> = ({
allContents = false,
discoverContents = false,
}) => {
const router = useRouter();

const theme = useTheme<any>();
const [searchTerm, setSearchTerm] = useState(value);
const sort: string = typeof router.query.sort === "string"
Expand Down
3 changes: 2 additions & 1 deletion src/pages/workspace/content/allContents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { timeAgo } from "@/utils/Helper";
import Loader from "@/components/Loader";
import NoDataFound from "@/components/NoDataFound";
import { MIME_TYPE } from "@/utils/app.config";
import router from "next/router";
import { useRouter } from "next/router";
import PaginationComponent from "@/components/PaginationComponent";
import { LIMIT } from "@/utils/app.constant";
import WorkspaceText from "@/components/WorkspaceText";
Expand Down Expand Up @@ -71,6 +71,7 @@ const columns = [
];
const AllContentsPage = () => {
const theme = useTheme<any>();
const router = useRouter();

const [selectedKey, setSelectedKey] = useState("allContents");
const [page, setPage] = useState(0);
Expand Down
49 changes: 19 additions & 30 deletions src/pages/workspace/content/discover-contents/index.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,28 @@
import KaTableComponent from "@/components/KaTableComponent";
import Loader from "@/components/Loader";
import PaginationComponent from "@/components/PaginationComponent";
import WorkspaceText from "@/components/WorkspaceText";
import { timeAgo } from "@/utils/Helper";
import { LIMIT } from "@/utils/app.constant";
import useSharedStore from "@/utils/useSharedState";
import {
Box,
Typography,
useTheme
} from "@mui/material";
import { DataType } from "ka-table/enums";
import "ka-table/style.css";
import { useRouter } from "next/router";
import React, {
useEffect,
useMemo,
useState,
useCallback,
useRef,
useState
} from "react";
import Layout from "../../../../components/Layout";
import {
Typography,
Box,
Table,
TableHead,
TableBody,
TableRow,
TableCell,
TablePagination,
IconButton,
useTheme,
} from "@mui/material";
import DeleteIcon from "@mui/icons-material/Delete";
import UpReviewTinyImage from "@mui/icons-material/LibraryBooks";
import SearchBox from "../../../../components/SearchBox";
import { deleteContent, getContent } from "../../../../services/ContentService";
import { timeAgo } from "@/utils/Helper";
import Loader from "@/components/Loader";
import NoDataFound from "@/components/NoDataFound";
import { MIME_TYPE } from "@/utils/app.config";
import router from "next/router";
import PaginationComponent from "@/components/PaginationComponent";
import { LIMIT } from "@/utils/app.constant";
import WorkspaceText from "@/components/WorkspaceText";
import { Table as KaTable } from "ka-table";
import { DataType } from "ka-table/enums";
import "ka-table/style.css";
import KaTableComponent from "@/components/KaTableComponent";
import useSharedStore from "@/utils/useSharedState";
import { getContent } from "../../../../services/ContentService";

// const columns = [
// { key: 'name', title: 'Content', dataType: DataType.String, width: "450px" },
// { key: 'lastUpdatedOn', title: 'Last Updated', dataType: DataType.String, width: "300px" },
Expand Down Expand Up @@ -74,6 +62,7 @@ const columns = [
];
const ContentsPage = () => {
const theme = useTheme<any>();
const router = useRouter();

const [selectedKey, setSelectedKey] = useState("discover-contents");
const [page, setPage] = useState(0);
Expand Down
4 changes: 3 additions & 1 deletion src/pages/workspace/content/submitted/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import PaginationComponent from "@/components/PaginationComponent";
import NoDataFound from "@/components/NoDataFound";
import { LIMIT } from "@/utils/app.constant";
import { MIME_TYPE } from "@/utils/app.config";
import router from "next/router";
import { useRouter } from "next/router";
import WorkspaceText from "@/components/WorkspaceText";
import { DataType } from "ka-table/enums";
import KaTableComponent from "@/components/KaTableComponent";
Expand Down Expand Up @@ -48,6 +48,8 @@ const columns = [
{ key: "action", title: "ACTION", dataType: DataType.String, width: "100px" },
];
const SubmittedForReviewPage = () => {
const router = useRouter();

const [selectedKey, setSelectedKey] = useState("submitted");
const filterOption: string[] = router.query.filterOptions
? JSON.parse(router.query.filterOptions as string)
Expand Down
4 changes: 3 additions & 1 deletion src/pages/workspace/content/up-review/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import PaginationComponent from "@/components/PaginationComponent";
import NoDataFound from "@/components/NoDataFound";
import { LIMIT } from "@/utils/app.constant";
import { MIME_TYPE } from "@/utils/app.config";
import router from "next/router";
import { useRouter } from "next/router";
import WorkspaceText from "@/components/WorkspaceText";
import { DataType } from 'ka-table/enums';
import KaTableComponent from "@/components/KaTableComponent";
Expand All @@ -37,6 +37,8 @@ const columns = [

]
const UpForReviewPage = () => {
const router = useRouter();

const [selectedKey, setSelectedKey] = useState("up-review");
const filterOption: string[] = router.query.filterOptions
? JSON.parse(router.query.filterOptions as string)
Expand Down

0 comments on commit c981bae

Please sign in to comment.