danmu-sim/app/danmu/page.tsx

71 lines
2.2 KiB
TypeScript
Raw Normal View History

2024-04-07 01:53:46 +08:00
import { getToken } from "@/lib/actions/token";
import Controls from "./controls";
2024-04-07 03:23:34 +08:00
import Danmu from "./danmu";
import { listLives } from "@/lib/actions/live";
import { listSongs } from "../songs/actions";
2024-04-06 02:12:38 +08:00
2024-04-07 01:53:46 +08:00
export default async function Page() {
const token = await getToken();
2024-04-07 03:23:34 +08:00
const lives = await listLives();
const songs = await listSongs();
2024-04-06 02:12:38 +08:00
return (
2024-04-07 01:53:46 +08:00
<div className="flex flex-col md:flex-row">
<section className="basis-1/3 card">
2024-04-07 03:23:34 +08:00
<div className="h-[50vh] md:h-[80vh] overflow-auto card bg-base-100 card-bordered m-8">
<div className="card-body">
<div className="card-title"></div>
<ul>
{lives.map((live, i) => (
<li key={i}>
<label>
{live.name} - {live.room_id}
<input
className="raido radio-primary"
type="radio"
name="live"
/>
</label>
</li>
))}
</ul>
</div>
</div>
2024-04-07 01:53:46 +08:00
</section>
<section className="basis-1/3 card">
2024-04-07 03:23:34 +08:00
<div className="h-[50vh] md:h-[80vh] overflow-auto card bg-base-100 card-bordered m-8">
<div className="card-body">
<div className="card-title"></div>
<ul>
{songs.map((song, i) => (
<li key={i}>
<label>
{song.name} - {song.artist}
<input
className="raido radio-primary"
type="radio"
name="song"
/>
</label>
</li>
))}
</ul>
</div>
</div>
2024-04-07 01:53:46 +08:00
</section>
<section className="basis-1/3 card">
<div className="card-body">
<div className="mockup-browser border">
<div className="mockup-browser-toolbar">
<div className="input"></div>
</div>
<div className="divide-y divide-gray-300">
<Controls />
<Danmu token={token} />
2024-04-06 02:12:38 +08:00
</div>
</div>
</div>
2024-04-07 01:53:46 +08:00
</section>
2024-04-06 02:12:38 +08:00
</div>
);
}