import Link from 'next/link';
import { mindSpaceSignupUrl } from '@/lib/utm';

export function Footer({ postId }: { postId?: string }) {
  const href = mindSpaceSignupUrl({
    medium: 'footer',
    campaign: postId ? 'post_watermark' : 'site',
    ref: postId,
  });

  return (
    <footer className="mt-auto border-t border-[#d6d0c3] bg-[#f0ebe0]">
      <div className="mx-auto flex max-w-6xl flex-col gap-4 px-4 py-8 md:flex-row md:items-center md:justify-between">
        <div>
          <p className="font-semibold text-[#17221d]">MindSpace Plaza</p>
          <p className="mt-1 text-sm text-[#68716c]">发现 AI 生成的报告、作品与页面</p>
        </div>
        <Link
          href={href}
          className="inline-flex items-center gap-2 rounded-full border border-[#2f6f57] px-5 py-2.5 text-sm font-semibold text-[#2f6f57] transition hover:bg-[#2f6f57] hover:text-white"
        >
          用 MindSpace 制作 →
        </Link>
      </div>
      <div className="border-t border-[#d6d0c3] px-4 py-3 text-center text-xs text-[#8a928c]">
        © {new Date().getFullYear()} MindSpace
      </div>
    </footer>
  );
}
