PageSourceSearch

https://top1000league.com/assets/BountyBoard-BZG8sUGa.js

js top1000league.com collected 2026-10-09 22:04:52 UTC 7,982 bytes, 11 lines download raw bytes

1import{j as e}from"./ui-vendor-59hLoTKd.js";import{a as r}from"./react-vendor-DHHkWg5p.js";import{a as M,s as m,K as W,N as E,w as l,C as o,F as I,Y as g,f as d,T as j,j as R,B as N}from"./index-B712TPBp.js";import{T as V,a as O,b as y,c as _}from"./tabs-CfZKoYVK.js";import{B as b}from"./BountyCard-BEu92uZ3.js";import{D as Q}from"./dollar-sign-Bay59-Cu.js";import"./supabase-D_pLX_lr.js";import"./query--LTQ4q54.js";import"./ShareButton-BW3TDyKv.js";import"./share-2-yFBYjMlR.js";import"./link-2-Dw0Rjg3x.js";import"./test-tube-diagonal-D5IDT0Ez.js";const te=()=>{const{user:U}=M(),[n,v]=r.useState([]),[u,C]=r.useState([]),[h,B]=r.useState(!0),[L,k]=r.useState(0),[c,f]=r.useState("all"),[x,S]=r.useState([]),[a,Y]=r.useState("");r.useEffect(()=>{w(),T();const s=m.channel("bounty-board-changes").on("postgres_changes",{event:"*",schema:"public",table:"bounties"},t=>{console.log("Bounty update received:",t),w()}).subscribe();return()=>{m.removeChannel(s)}},[]);const T=async()=>{try{const{data:s,error:t}=await m.from("most_wanted_titles").select("user_id").eq("city","Chicago").is("lost_at",null);if(t)throw t;const i=[...new Set((s||[]).map(p=>p.user_id))];S(i)}catch(s){console.error("Error loading Most Wanted IDs:",s)}},w=async()=>{try{const{data:s}=await m.from("bounties").select(`
2          *,
3          creator:creator_id(id, username, photo_url),
4          target_player:target_player_id(id, username, photo_url, elo_rating),
5          winner:winner_id(id, username, photo_url)
6        `).in("status",["active","active_simulated"]).order("created_at",{ascending:!1}).limit(50),{data:t}=await m.from("bounties").select(`
7          *,
8          creator:creator_id(id, username, photo_url),
9          target_player:target_player_id(id, username, photo_url, elo_rating),
10          winner:winner_id(id, username, photo_url)
11        `).in("status",["claimed","claimed_simulated"]).order("claimed_at",{ascending:!1}).limit(20);v(s||[]),C(t||[]);const i=new Date;i.setDate(i.getDate()-7);const{data:p}=await m.from("bounties").select("amount").gte("created_at",i.toISOString()),D=p?.reduce((F,A)=>F+Number(A.amount),0)||0;k(D)}catch(s){console.error("Error loading bounties:",s),W.error("Failed to load bounties")}finally{B(!1)}};return n.filter(s=>{const t=!a||s.title.toLowerCase().includes(a.toLowerCase())||s.target_player?.username.toLowerCase().includes(a.toLowerCase())||s.creator.username.toLowerCase().includes(a.toLowerCase()),i=c==="all"||c==="most_wanted"&&s.target_player&&x.includes(s.target_player.id);return t&&i}),u.filter(s=>!a||s.title.toLowerCase().includes(a.toLowerCase())||s.target_player?.username.toLowerCase().includes(a.toLowerCase())||s.winner?.username.toLowerCase().includes(a.toLowerCase())),h?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(E,{}),e.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-7xl",children:[e.jsx(l,{className:"h-12 w-64 mb-8 mx-auto"}),e.jsxs("div",{className:"mb-6 space-y-4",children:[e.jsx(l,{className:"h-10 w-full max-w-md mx-auto"}),e.jsxs("div",{className:"flex gap-2 justify-center",children:[e.jsx(l,{className:"h-10 w-32"}),e.jsx(l,{className:"h-10 w-32"})]})]}),e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:[1,2,3,4,5,6].map(s=>e.jsxs(o,{className:"p-6",children:[e.jsx(l,{className:"h-6 w-32 mb-4"}),e.jsx(l,{className:"h-8 w-24 mb-2"}),e.jsx(l,{className:"h-20 w-full mb-4"}),e.jsx(l,{className:"h-10 w-full"})]},s))})]}),e.jsx(I,{})]}):e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-background via-background to-secondary/10 py-8",children:e.jsxs("div",{className:"container max-w-7xl px-4",children:[e.jsxs("div",{className:"mb-8 text-center",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 mb-4 px-4 py-2 bg-primary/10 rounded-full",children:[e.jsx(g,{className:"w-5 h-5 text-primary animate-pulse"}),e.jsx("span",{className:"text-sm font-semibold text-primary",children:"LIVE BOUNTY BOARD"})]}),e.jsx("h1",{className:"text-4xl md:text-5xl font-bold tracking-tight mb-3 bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"The Bounty Board"}),e.jsx("p",{className:"text-muted-foreground text-lg max-w-2xl mx-auto",children:"Real money. Real stakes. Prove your worth on the court."})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-3 sm:gap-4 mb-6 sm:mb-8",children:[e.jsx(o,{className:"border-primary/20 bg-gradient-to-br from-card to-primary/5",children:e.jsx(d,{className:"pt-4 sm:pt-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground font-medium",children:"Active Bounties"}),e.jsx("p",{className:"text-2xl sm:text-3xl font-bold",children:n.length})]}),e.jsx(j,{className:"h-6 w-6 sm:h-8 sm:w-8 text-primary opacity-50 shrink-0"})]})})}),e.jsx(o,{children:e.jsx(d,{className:"pt-4 sm:pt-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Weekly Volume"}),e.jsxs("p",{className:"text-2xl sm:text-3xl font-bold",children:["$",L.toFixed(0)]})]}),e.jsx(R,{className:"h-6 w-6 sm:h-8 sm:w-8 text-green-500 opacity-50 shrink-0"})]})})}),e.jsx(o,{children:e.jsx(d,{className:"pt-4 sm:pt-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Total at Stake"}),e.jsxs("p",{className:"text-2xl sm:text-3xl font-bold",children:["$",n.reduce((s,t)=>s+Number(t.amount),0).toFixed(0)]})]}),e.jsx(Q,{className:"h-6 w-6 sm:h-8 sm:w-8 text-yellow-500 opacity-50 shrink-0"})]})})})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-center mb-6",children:[e.jsx(N,{variant:c==="all"?"default":"outline",onClick:()=>f("all"),className:"w-full sm:w-auto min-h-[44px]",children:"All Bounties"}),e.jsxs(N,{variant:c==="most_wanted"?"default":"outline",onClick:()=>
11f("most_wanted"),className:"gap-2 w-full sm:w-auto min-h-[44px]",children:[e.jsx(g,{className:"w-4 h-4"}),"Most Wanted Only"]})]}),e.jsxs(V,{defaultValue:"active",className:"space-y-6",children:[e.jsxs(O,{className:"grid w-full grid-cols-2 max-w-md mx-auto",children:[e.jsx(y,{value:"active",children:"Active Bounties"}),e.jsx(y,{value:"claimed",children:"Recently Claimed"})]}),e.jsxs(_,{value:"active",className:"space-y-4",children:[h?e.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"Loading bounties..."}):n.length===0?e.jsx(o,{children:e.jsxs(d,{className:"py-12 text-center",children:[e.jsx(j,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground opacity-50"}),e.jsx("p",{className:"text-muted-foreground",children:"No active bounties yet. Be the first to place one!"})]})}):n.filter(s=>c==="all"||s.target_player_id&&x.includes(s.target_player_id)||s.creator_id&&x.includes(s.creator_id)).map(s=>e.jsx(b,{bounty:s},s.id)),c==="most_wanted"&&n.filter(s=>s.target_player_id&&x.includes(s.target_player_id)||s.creator_id&&x.includes(s.creator_id)).length===0&&e.jsx(o,{children:e.jsxs(d,{className:"py-12 text-center",children:[e.jsx(g,{className:"h-12 w-12 mx-auto mb-4 text-orange-500 opacity-50"}),e.jsx("p",{className:"text-muted-foreground",children:"No bounties on Most Wanted players yet. Create one now!"})]})})]}),e.jsx(_,{value:"claimed",className:"space-y-4",children:h?e.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"Loading claimed bounties..."}):u.length===0?e.jsx(o,{children:e.jsxs(d,{className:"py-12 text-center",children:[e.jsx(j,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground opacity-50"}),e.jsx("p",{className:"text-muted-foreground",children:"No bounties claimed yet!"})]})}):u.map(s=>e.jsx(b,{bounty:s},s.id))})]})]})})};export{te as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.