File size: 2,533 Bytes
b087e88
 
7f6ef8f
 
 
 
 
 
 
 
 
 
f762ee5
 
7f6ef8f
b087e88
 
 
 
 
f762ee5
7f6ef8f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f762ee5
ed37070
b087e88
 
a1f1bf8
b087e88
 
 
 
 
 
 
 
 
 
f762ee5
 
a1f1bf8
7f6ef8f
 
 
 
 
 
 
 
 
 
 
 
ed37070
7f6ef8f
f762ee5
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import { useState, useEffect } from 'react'
import LeaderboardPage from './components/LeaderboardPage'
import Examples from './components/Examples'

const TABS = [
  { label: 'Audio', type: 'audio-leaderboard' },
  { label: 'Image', type: 'image-leaderboard' },
  { label: 'Video', type: 'video-leaderboard' },
  { label: 'Image Examples', type: 'image-examples' },
  { label: 'Audio Examples', type: 'audio-examples' },
  { label: 'Video Examples', type: 'video-examples' },
]

function App() {
  const [activeTab, setActiveTab] = useState<string>('audio-leaderboard')
  const [theme, setTheme] = useState<'dark' | 'light'>('dark')

  useEffect(() => {
    document.documentElement.setAttribute('data-theme', theme)
  }, [theme])

  let content = null
  if (activeTab === 'audio-leaderboard') {
    content = <LeaderboardPage datasetType="audio" />
  } else if (activeTab === 'image-leaderboard') {
    content = <LeaderboardPage datasetType="image" />
  } else if (activeTab === 'video-leaderboard') {
    content = <LeaderboardPage datasetType="video" />
  } else if (activeTab === 'image-examples') {
    content = <Examples fileType="image" />
  } else if (activeTab === 'audio-examples') {
    content = <Examples fileType="audio" />
  } else if (activeTab === 'video-examples') {
    content = <Examples fileType="video" />
  }

  return (
    <div className="min-h-screen w-11/12 mx-auto">
      <div className="bg-base-100 my-4">
        <div className="flex flex-row justify-between items-center">
          <h2 className="card-title">🥇 Omni Seal Bench Watermarking Leaderboard</h2>
          <div className="flex justify-end items-center gap-2">
            <span className="text-sm">{theme === 'dark' ? '🌙 Dark Mode' : '☀️ Light Mode'}</span>
            <input
              type="checkbox"
              className="toggle"
              checked={theme === 'dark'}
              onChange={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
              aria-label="Toggle dark mode"
            />
          </div>
        </div>
      </div>

      <div className="tabs tabs-border mb-2 ">
        {TABS.map((tab) => (
          <input
            key={tab.type}
            type="radio"
            name="leaderboard_tabs"
            className="tab"
            aria-label={tab.label}
            checked={activeTab === tab.type}
            onChange={() => setActiveTab(tab.type)}
          />
        ))}
      </div>
      <div className="w-full ">{content}</div>
    </div>
  )
}

export default App