"use client"; import { useState } from "react"; import { useRouter } from "next/navigation"; import Link from "next/link"; import { api } from "@/lib/api"; import { useAuth } from "@/lib/auth"; import { useToast } from "@/lib/toast"; import { useI18n } from "@/lib/i18n"; export default function GigPostClient() { const { token } = useAuth(); const router = useRouter(); const { toast } = useToast(); const { t } = useI18n(); const [title, setTitle] = useState(""); const [description, setDescription] = useState(""); const [budget, setBudget] = useState(""); const [deadline, setDeadline] = useState(""); const submit = async () => { if (!token) { router.push("/login?next=/gigs/post"); return; } try { await api.createGig(token, { title, description, budget, deadline }); toast(t.gigs.postOk, "success"); router.push("/gigs"); } catch { toast(t.gigs.postFail, "error"); } }; return (