// "use client"; // import { createClient } from "@/utils/supabase/client"; // import React, { useState, useEffect } from 'react'; // import { User } from "@supabase/supabase-js"; // import Search from "@/components/ui/search"; // function PageComponent() { // const supabase = createClient(); // const [showNSFW, setShowNSFW] = useState(true); // const [randomIds, setRandomIds] = useState([]); // replace any with your gallery type // const [isOpen, setIsOpen] = useState(false); // const [galleries, setGalleries] = useState([]); // replace any with your gallery type // const [user, setUser] = useState(null); // const [loading, setLoading] = useState(true); // const [selectedGallery, setSelectedGallery] = useState(null); // const [search, setSearch] = useState(''); // const [galleryColumns, setColumns] = useState(0); // const [selectedTags, setSelectedTags] = useState([]); // const generateRandomString = function (length: number) { // let result = ''; // let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; // let charactersLength = characters.length; // for (let i = 0; i < length; i++) { // result += characters.charAt(Math.floor(Math.random() * charactersLength)); // } // return result; // } // const selectGallery = (gallery: string, columns: number) => { // setRandomIds([generateRandomString(3), generateRandomString(3), generateRandomString(3), generateRandomString(3)]); // setSelectedGallery(gallery); // setColumns(columns); // setIsOpen(true); // }; // const closeGallery = () => { // setSelectedGallery(null); // setColumns(0); // setIsOpen(false); // } // const getData = async () => { // let { data: { user } } = await supabase.auth.getUser(); // const galleriesResponse = await fetch(`/api/galleries?search=` + search + '&nsfw=' + showNSFW, { // method: 'POST', // headers: { // 'Content-Type': 'application/json' // }, // body: JSON.stringify({ tags: selectedTags }) // }); // const galleriesData = await galleriesResponse.json(); // setGalleries(galleriesData); // setUser(user); // setLoading(false); // } // useEffect(() => { // getData(); // }, [selectedTags, search, showNSFW]); // return ( //
//
// Background //
// // {/* // These are the thumbnails for the gallery below the search bar // */} //
// {galleries && galleries.map((gallery, index) => ( //
// //
// ))} //
// {isOpen ? ( // <> // {/* // This is the modal for holding the gallery // */} // // // ) : null} //
// ); // } // export default PageComponent;