"use client"; import { createClient } from "@/utils/supabase/client"; import React, { useState, useEffect } from 'react'; import Search from "@/components/neroshitron/search"; import Gallery from "@/components/neroshitron/gallery"; import Masonry from "react-masonry-css"; import SearchInput from "@/components/neroshitron/search_input"; import GalleryThumbnail from "@/components/neroshitron/gallery_thumbnail"; function PageComponent() { const [filePreviews, setFilePreviews] = useState([]); const supabase = createClient(); const user = supabase.auth.getUser(); const [gallery , setGallery] = useState(null); const [galleryName, setGalleryName] = useState(''); const getData = async () => { const urlParams = new URLSearchParams(window.location.search); const id = urlParams.get('id'); const galleryResponse = await fetch(`/api/galleries/admin/${id}`, { method: 'GET', headers: { 'Content-Type': 'application/json' } }); const galleryData = await galleryResponse.json(); setGallery(galleryData.gallery); setGalleryName(galleryData.gallery.name); } useEffect(() => { getData(); }, []); useEffect(() => { }, [gallery]); return (
{gallery != null && ( )}
setGalleryName(e.target.value)} />
{}} nsfwChanged={(nsfw) => {}} tagsChanged={(tags) => {}} />
{filePreviews.map((preview, index) => ( {`Preview ))}
); } export default PageComponent;