diff --git a/src/app/components/BiddingTable.tsx b/src/app/components/BiddingTable.tsx index 8a08968..f169732 100644 --- a/src/app/components/BiddingTable.tsx +++ b/src/app/components/BiddingTable.tsx @@ -1,24 +1,19 @@ import React from "react"; -import { useEffect, useState } from "react"; +import { useState } from "react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog"; -import { Input } from "@/components/ui/input"; -import { Label } from "@/components/ui/label"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; -import { Icon } from "@iconify/react"; -import { QueryObserverResult } from "@tanstack/react-query"; +import type { QueryObserverResult } from "@tanstack/react-query"; import axios from "axios"; import { Trash2 } from "lucide-react"; -import type { ToastMessage } from "@/src/app/dashboard/jersey/page"; - -import { BiddingData, EligibleBids, UserBid } from "../dashboard/jersey/types"; +import type { BiddingData, EligibleBids, UserBid } from "@/src/app/dashboard/jersey/types"; interface BiddingList { - user:any, + user: any; userBids: UserBid; refetchUserBids: () => Promise>; biddings: BiddingData; @@ -32,7 +27,7 @@ interface BiddingList { axios.defaults.withCredentials = true; // User submit bid form -const BiddingTable: React.FC = ({user, userBids, refetchUserBids, biddings, userEligibleBids }) => { +const BiddingTable: React.FC = ({ user, userBids, refetchUserBids, biddings, userEligibleBids }) => { const [open, setOpen] = useState(false); const [selectedNumber, setSelectedNumber] = useState(null); const priority = userBids ? userBids.bids.length : 0; @@ -195,40 +190,42 @@ const BiddingTable: React.FC = ({user, userBids, refetchUserBids, b

Bidding Table

- - {user.username} - Year: {user.year}, Gender: {user.gender} - - -
-
-
-

Round To Bid: {userBids.info.round}

-

Current Round: {userBids.system.bidRound}

-
-
-

Status:

-

{canBid ? "Can Bid" : "Cannot Bid"}

-
-
-

Points:

-

{userBids.info.points.toLocaleString()}

-
-
-

Teams :

-
- {userBids.info.teams.map(team => ( - - {team.team.name} - - ))} -
+ + {user.username} + + Year: {user.year}, Gender: {user.gender} + + + +
+
+
+

Round To Bid: {userBids.info.round}

+

Current Round: {userBids.system.bidRound}

+
+
+

Status:

+

{canBid ? "Can Bid" : "Cannot Bid"}

+
+
+

Points:

+

{userBids.info.points.toLocaleString()}

+
+
+

Teams :

+
+ {userBids.info.teams.map(team => ( + + {team.team.name} + + ))}
-
- - +
+
+
+ {userBids && ( @@ -277,7 +274,7 @@ const BiddingTable: React.FC = ({user, userBids, refetchUserBids, b

Eligible Bidding Numbers :

- {Array.from({ length: 100 }, (_, i) => i ).map(number => { + {Array.from({ length: 100 }, (_, i) => i).map(number => { const isEligible = userEligibleBids !== undefined ? userEligibleBids.jerseys.includes(number) : false; // Check if the number is eligible return (