import { useState } from 'react'
import API from './API'
import DataChart from './components/DataChart'
import LeaderboardTable from './components/LeaderboardTable'
import Examples from './components/Examples'

function App() {
  const file = 'voxpopuli_1k_audio'
  const [activeTab, setActiveTab] = useState<
    'dataChart' | 'leaderboard' | 'imageExamples' | 'audioExamples' | 'videoExamples'
  >('dataChart')

  return (
    <div className="min-h-screen w-11/12 mx-auto">
      <div className="card max-w-4xl bg-base-100">
        <div className="card-body">
          <h2 className="card-title">🥇 Omni Seal Bench Watermarking Leaderboard</h2>
        </div>
      </div>
      <div className="tabs tabs-border">
        <input
          type="radio"
          name="my_tabs_6"
          className="tab"
          aria-label="Data Chart"
          checked={activeTab === 'dataChart'}
          onChange={() => setActiveTab('dataChart')}
          defaultChecked
        />
        <div className="tab-content bg-base-100 border-base-300 p-6">
          <DataChart file={file} />
        </div>

        <input
          type="radio"
          name="my_tabs_6"
          className="tab"
          aria-label="Leaderboard Table"
          checked={activeTab === 'leaderboard'}
          onChange={() => setActiveTab('leaderboard')}
        />
        <div className="tab-content bg-base-100 border-base-300 p-6">
          <LeaderboardTable file={file} />
        </div>

        <input
          type="radio"
          name="my_tabs_6"
          className="tab"
          aria-label="Image Examples"
          checked={activeTab === 'imageExamples'}
          onChange={() => setActiveTab('imageExamples')}
        />
        <div className="tab-content bg-base-100 border-base-300 p-6">
          <Examples fileType="image" />
        </div>

        <input
          type="radio"
          name="my_tabs_6"
          className="tab"
          aria-label="Audio Examples"
          checked={activeTab === 'audioExamples'}
          onChange={() => setActiveTab('audioExamples')}
        />
        <div className="tab-content bg-base-100 border-base-300 p-6">
          <Examples fileType="audio" />
        </div>

        <input
          type="radio"
          name="my_tabs_6"
          className="tab"
          aria-label="Video Examples"
          checked={activeTab === 'videoExamples'}
          onChange={() => setActiveTab('videoExamples')}
        />
        <div className="tab-content bg-base-100 border-base-300 p-6">
          <Examples fileType="video" />
        </div>
      </div>
    </div>
  )
}

export default App
