import { FC } from "react"; import { useSearchParams } from "next/navigation"; import Image from "next/image"; import { useTheme } from "next-themes"; // helpers import { API_BASE_URL } from "@/helpers/common.helper"; // images import githubLightModeImage from "/public/logos/github-black.png"; import githubDarkModeImage from "/public/logos/github-dark.svg"; export type GithubOAuthButtonProps = { text: string; }; export const GithubOAuthButton: FC = (props) => { const searchParams = useSearchParams(); const nextPath = searchParams.get("next_path") || undefined; const { text } = props; // hooks const { resolvedTheme } = useTheme(); const handleSignIn = () => { window.location.assign(`${API_BASE_URL}/auth/spaces/github/${nextPath ? `?next_path=${nextPath}` : ``}`); }; return ( ); };