import { appConfig } from "@/lib/config"

export function SiteFooter() {
  return (
    <footer className="border-t py-6 md:py-0">
      <div className="container flex flex-col items-center justify-between gap-4 md:h-14 md:flex-row">
        <p className="text-center text-sm leading-loose text-muted-foreground md:text-left">
          © {new Date().getFullYear()} {appConfig.name}. Todos os direitos reservados.
        </p>
        {(appConfig.supportEmail || appConfig.supportWhatsapp) && (
          <p className="text-center text-sm text-muted-foreground md:text-right">
            Suporte:{" "}
            {appConfig.supportEmail && (
              <a href={`mailto:${appConfig.supportEmail}`} className="underline underline-offset-4 hover:text-foreground">
                {appConfig.supportEmail}
              </a>
            )}
            {appConfig.supportEmail && appConfig.supportWhatsapp && " · "}
            {appConfig.supportWhatsapp && (
              <a
                href={`https://wa.me/${appConfig.supportWhatsapp}`}
                target="_blank"
                rel="noreferrer"
                className="underline underline-offset-4 hover:text-foreground"
              >
                WhatsApp
              </a>
            )}
          </p>
        )}
      </div>
    </footer>
  )
}
