import React, { useEffect, useState } from 'react';
import { Table, Typography, Spin, Message, Card, Empty, Badge } from '@arco-design/web-react';
import { IconArrowRise, IconArrowFall } from '@arco-design/web-react/icon';
import '@arco-design/web-react/dist/css/arco.css';
import API_BASE_URL from '../config';
const columns = (bids) => [
{
title: 'Timestamp',
dataIndex: 'timestamp',
sorter: (a, b) => new Date(a.timestamp) - new Date(b.timestamp),
render: (val) => new Date(val).toLocaleString(),
width: 180,
},
{
title: 'Quantity (MW)',
dataIndex: 'quantity',
sorter: (a, b) => a.quantity - b.quantity,
render: (val) => val.toFixed(2),
width: 180,
},
{
title: 'Price ($/MWh)',
dataIndex: 'price',
sorter: (a, b) => a.price - b.price,
render: (val) => `$${val.toFixed(2)}`,
width: 180,
},
{
title: 'Status',
dataIndex: 'status',
sorter: (a, b) => a.status.localeCompare(b.status),
filters: [
{ text: 'Submitted', value: 'Submitted' },
{ text: 'Success', value: 'Success' },
{ text: 'Fail', value: 'Fail' },
],
onFilter: (value, record) => record.status === value,
render: (val) => (