first commit

This commit is contained in:
2025-12-30 14:38:36 +07:00
commit ed079f44b9
255 changed files with 40351 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
"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 (
<div className={styles.container}>
<div className={styles.header}>
<Link
className={styles.back}
href="/dashboard">
<BsArrowLeft /> back
</Link>
</div>
<div className={styles.body}>
<GalleryComponent initialData={galleryData} />
</div>
</div>
);
};
export default GalleryPage;