import { signIn } from 'next-auth/react' interface SocialLoginButtonsProps { callbackUrl?: string providers?: string[] } const providerConfig: Record = { github: { name: 'GitHub', icon: ( ), bgColor: 'bg-gray-900 hover:bg-gray-800', }, google: { name: 'Google', icon: ( ), bgColor: 'bg-white hover:bg-gray-50 border border-gray-300', }, } export function SocialLoginButtons({ callbackUrl = '/', providers = ['github', 'google'] }: SocialLoginButtonsProps) { const handleSignIn = (providerId: string) => { signIn(providerId, { callbackUrl }) } const availableProviders = providers.filter((p) => p in providerConfig) if (availableProviders.length === 0) { return null } return (
{availableProviders.map((providerId) => { const config = providerConfig[providerId] const isGoogle = providerId === 'google' return ( ) })}
) } export function SocialDivider() { return (
Or continue with
) } export default SocialLoginButtons