fp/services/next/app/components/auth-buttons.tsx

42 lines
878 B
TypeScript

"use client";
import { signIn, signOut } from "next-auth/react";
import Link from "next/link";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faUser } from "@fortawesome/free-solid-svg-icons";
export const LoginButton = () => {
return (
<button className="button" onClick={() => signIn('keycloak')}>
Sign in
</button>
);
};
export const RegisterButton = () => {
return (
<Link href="/register" style={{ marginRight: 10 }}>
Register
</Link>
);
};
export const LogoutButton = () => {
return (
<button className="button" onClick={() => signOut()}>
Sign Out
</button>
);
};
export const ProfileButton = () => {
return (
<Link className="button" href="/profile">
<FontAwesomeIcon
icon={faUser}
className="fas fa-user-large mr-1"
/>Profile
</Link>
)
};