import { checkAuth } from "@/utils/auth"; import { redirect } from "next/navigation"; export default function WithAuth(WrappedComponent) { return checkAuth() ? WrappedComponent : redirect("/login"); }