import { APP_CONFIG } from "@/config/app-config";
import { cn } from "@/lib/utils";

type AppPoweredByFooterProps = {
  className?: string;
};

/** Global sticky bottom bar: “All Rights Reserved. Powered By Oxyfinz”. */
export function AppPoweredByFooter({ className }: AppPoweredByFooterProps) {
  return (
    <footer
      className={cn(
        "sticky bottom-0 z-40 shrink-0 border-t border-primary/20 bg-primary px-3 py-1 text-center text-[11px] leading-none text-primary-foreground sm:text-xs",
        className,
      )}
    >
      <span>All Rights Reserved. Powered By </span>
      <a
        href={APP_CONFIG.poweredByUrl}
        target="_blank"
        rel="noopener noreferrer"
        className="font-medium underline underline-offset-2 hover:text-primary-foreground/90"
      >
        {APP_CONFIG.name}
      </a>
    </footer>
  );
}
