"use client"

import { useSearchParams } from "next/navigation"
import { HeroBanner } from "./hero-banner"
import { TopMatches } from "./top-matches"
import { SportsNav } from "./sports-nav"
import { HomeTabs } from "./home-tabs"
import { EventsList } from "./events-list"

export function SportHome() {
  const searchParams = useSearchParams()
  const isLeagueView = !!searchParams.get("league")

  return (
    <div className="flex flex-col gap-3">
      {!isLeagueView && (
        <>
          <HeroBanner />
          <TopMatches />
          <SportsNav />
          <HomeTabs />
        </>
      )}
      <EventsList />
    </div>
  )
}
