2024-06-29 05:22:22 +00:00
|
|
|
import { DataTable } from "./data-table";
|
|
|
|
import { getSongsWithTitles } from "@/lib/api";
|
|
|
|
import { Song, columns } from "./colums";
|
|
|
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
2024-06-29 18:43:11 +00:00
|
|
|
import { getAuth } from "@/auth/queries/getauth";
|
2024-06-29 05:22:22 +00:00
|
|
|
|
|
|
|
const ChunithmData = async () => {
|
2024-06-29 18:43:11 +00:00
|
|
|
const { user } = await getAuth();
|
|
|
|
let songs: Song[] = [];
|
2024-06-29 05:22:22 +00:00
|
|
|
|
2024-06-29 18:43:11 +00:00
|
|
|
if (user?.UserId !== undefined) {
|
|
|
|
songs = await getSongsWithTitles(user.UserId);
|
|
|
|
} else {
|
|
|
|
return {
|
|
|
|
error: "no user id ",
|
|
|
|
};
|
|
|
|
}
|
2024-06-29 05:22:22 +00:00
|
|
|
return (
|
|
|
|
<div className="p-10">
|
2024-06-29 18:43:11 +00:00
|
|
|
<DataTable columns={columns} data={songs} />
|
2024-06-29 05:22:22 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ChunithmData;
|