import { getTranslations } from 'next-intl/server'
import TradesTable from '@/components/trades/TradesTable'
import { getTrades } from '@/lib/api'

export const revalidate = 10

export default async function TradesPage() {
  const t = await getTranslations('trades')
  const trades = await getTrades(100, 1).catch(() => [])

  return (
    <div className="max-w-[1400px] mx-auto px-6 py-6 pt-20">
      <h1 className="text-[22px] font-medium text-white mb-5">{t('title')}</h1>
      <TradesTable trades={trades} />
    </div>
  )
}
