import { InterestDetail } from '@/components/interests/interest-detail';
import { TrackEntityView } from '@/components/search/track-entity-view';
import { auth } from '@/lib/auth';
import { headers } from 'next/headers';

interface InterestDetailPageProps {
  params: Promise<{ interestId: string }>;
}

export default async function InterestDetailPage({ params }: InterestDetailPageProps) {
  const { interestId } = await params;

  const session = await auth.api.getSession({ headers: await headers() });
  const currentUserId = session?.user?.id;

  return (
    <>
      <TrackEntityView type="interest" id={interestId} />
      <InterestDetail interestId={interestId} currentUserId={currentUserId} />
    </>
  );
}
