import {redirect} from "next/navigation"
import { headers } from 'next/headers'
import Feed from "@/components/Feed"
import SearchBar from "@/components/SearchBar"
type Props = {
searchParams?: {
q?: string | undefined
};
}
export default function Home({searchParams}: Props) {
const headerList = headers()
const referer = headerList.get("referer")
if(!referer && searchParams?.q) {
redirect(`/search?q=${searchParams.q}`)
}
return (
<>