"use client" import { useEffect, useState } from "react" import { AdvancedIconSubmissionForm } from "@/components/advanced-icon-submission-form" import { LoginModal } from "@/components/login-modal" import { Button } from "@/components/ui/button" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { pb } from "@/lib/pb" export default function SubmitPage() { const [isAuthenticated, setIsAuthenticated] = useState(false) const [isLoading, setIsLoading] = useState(true) const [showLoginModal, setShowLoginModal] = useState(false) useEffect(() => { const checkAuth = () => { setIsAuthenticated(pb.authStore.isValid) setIsLoading(false) } checkAuth() // Subscribe to auth changes pb.authStore.onChange(() => { checkAuth() }) }, []) if (isLoading) { return (
Loading...
{isAuthenticated ? "Create a new icon or update an existing one" : "Sign in to submit icons"}