All files / src/app/admin/audit/_components ComplianceButton.tsx

100% Statements 5/5
66.66% Branches 4/6
100% Functions 1/1
100% Lines 4/4

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 253x                       838x 838x 324x                    
"use client";
 
import { Mail } from "lucide-react";
import { useT } from "@/lib/i18n/translate";
 
export function ComplianceButton({
  name,
  email,
}: {
  name?: string;
  email?: string;
}) {
  const t = useT("admin");
  if (!email) return null;
  return (
    <a
      href={`mailto:${email}?subject=Data Access Restriction Request`}
      title={t("Contact compliance officer: {name}", { name: name ?? email })}
      className="inline-flex items-center gap-1 px-1.5 py-0.5 rounded-sm text-[10px] bg-(--role-hdab-bg) text-(--role-hdab-text) border border-(--role-hdab-border) hover:opacity-80 transition-opacity"
    >
      <Mail size={9} /> {name ?? email}
    </a>
  );
}