/* global React, Eyebrow, Badge, Icon, Button, api */
const { useState: useStateCG, useEffect: useEffectCG } = React;
const FALLBACK = [
{name:"Rizz โ AI dating replies", tag:"Dating ยท Lifestyle", rpm:1.00, min_views:1000, budget_remaining:24000, monthly_budget:25000, hot:true, tint:"#6366f1", status:"live"},
];
function CampaignGrid({ onJoin }){
const [campaigns, setCampaigns] = useStateCG(FALLBACK);
useEffectCG(() => {
let mounted = true;
api.listLiveCampaigns().then(r => {
if (!mounted || r.error || !r.data) return;
if (r.data.length > 0) setCampaigns(r.data);
});
return () => { mounted = false; };
}, []);
// Always show one "coming soon" tile after the live ones
const display = [...campaigns, { soon: true, name: "Coming soon โ Campaign #2", tag: "TBA", tint: "#2C2C2A" }];
return (
Pick what you post.
{c.name}