import { DataTable } from "./data-table";
import { getSongsWithTitles } from "@/lib/api";
import { Song, columns } from "./colums";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { getAuth } from "@/auth/queries/getauth";

const ChunithmData = async () => {
  const { user } = await getAuth();
  let songs: Song[] = [];

  if (user?.UserId !== undefined) {
    songs = await getSongsWithTitles(user.UserId);
  } else {
    return {
      error: "no user id ",
    };
  }
  return (
    <div className="p-10">
      <DataTable columns={columns} data={songs} />
    </div>
  );
};

export default ChunithmData;
