"use server"; import React from "react"; import Link from "next/link"; import styles from "@/app/(Admin)/dashboard/gallery/gallery.module.css"; import GalleryComponent from "@/components/administrator/Gallery/gallery"; import { BsArrowLeft } from "react-icons/bs"; import { getGallery } from "@/models/gallery.model"; const GalleryPage = async ({ searchParams }) => { const query = await searchParams; let page = query?.page || 1; const limit = 50; const sort = query?.sort ? JSON.parse(query.sort) : { createdAt: -1 }; const search = query?.search || null; if (search) page = 1; const galleryData = await getGallery( { page: parseInt(page), limit }, sort, search ); return (
back
); }; export default GalleryPage;