danmu-sim/app/songs/page.tsx

40 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-04-06 23:32:31 +08:00
import { deleteSong, listSongs } from "./actions";
import DeleteSongButton from "./delete-song-button";
import SearchForm from "./search-form";
export default async function Page() {
const songs = await listSongs();
2024-04-06 04:24:58 +08:00
return (
<section className="bg-gray-100">
<div className="container mx-auto px-4 py-8">
<div className="grid grid-cols-2 gap-8">
<div>
<h2 className="text-xl font-bold mb-4"></h2>
2024-04-06 04:24:58 +08:00
<ul className="bg-white rounded shadow-md p-4">
{songs.map((song, i) => (
<li
className="flex justify-between items-center py-2 border-b"
key={i}
>
<span>
{song.name} - {song.artist}
</span>
2024-04-06 23:32:31 +08:00
<DeleteSongButton
className="text-red-500 hover:text-red-700"
id={song.id}
/>
</li>
))}
2024-04-06 04:24:58 +08:00
</ul>
</div>
<div>
<h2 className="text-xl font-bold mb-4"></h2>
<SearchForm className="mb-4" />
2024-04-06 04:24:58 +08:00
</div>
</div>
</div>
</section>
);
}