Spaces:
Running
Running
File size: 2,821 Bytes
b087e88 98847a8 b087e88 f762ee5 ed37070 54be5f9 b087e88 f762ee5 ed37070 b087e88 a1f1bf8 b087e88 f762ee5 a1f1bf8 54be5f9 ed37070 b087e88 ed37070 b087e88 ed37070 98847a8 ed37070 b087e88 ed37070 b087e88 ed37070 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 75 76 77 78 79 80 81 82 83 84 85 86 87 |
import { useState, useEffect } from 'react'
import Examples from './components/Examples'
import LeaderboardPage from './components/LeaderboardPage'
function App() {
const [activeTab, setActiveTab] = useState<
'leaderboard' | 'imageExamples' | 'audioExamples' | 'videoExamples'
>('leaderboard')
const [theme, setTheme] = useState<'dark' | 'light'>('dark')
useEffect(() => {
document.documentElement.setAttribute('data-theme', theme)
}, [theme])
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">
<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 ">
<LeaderboardPage />
</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 ">
{activeTab === 'imageExamples' ? <Examples fileType="image" /> : null}
</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 ">
{activeTab === 'audioExamples' ? <Examples fileType="audio" /> : null}
</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 ">
{activeTab === 'videoExamples' ? <Examples fileType="video" /> : null}
</div>
</div>
</div>
)
}
export default App
|