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

42 lines
878 B
TypeScript
Raw Normal View History

2024-12-12 07:23:46 +00:00
"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>
)
};