All files / src/components SignInRequired.tsx

100% Statements 2/2
100% Branches 1/1
100% Functions 2/2
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30                      3x                   1x                
"use client";
 
import { signIn } from "next-auth/react";
 
export function SignInRequired({
  title = "Sign in required",
  description,
}: {
  title?: string;
  description: string;
}) {
  return (
    <div className="flex flex-col items-center justify-center gap-4 py-16 text-center">
      <p className="text-lg font-semibold text-[var(--text-primary)]">
        {title}
      </p>
      <p className="max-w-md text-sm text-[var(--text-secondary)]">
        {description}
      </p>
      <button
        type="button"
        onClick={() => signIn("keycloak")}
        className="rounded bg-[var(--accent)] px-4 py-2 text-sm font-medium text-white hover:opacity-90"
      >
        Sign in
      </button>
    </div>
  );
}