/**
 * AnnouncementBar.jsx — 顶部公告条（React island）。迁自原型 .ann + site.js __closeAnn。
 */
import { useState } from 'react';
import { Gift, X } from 'lucide-react';

export default function AnnouncementBar({ text, cta }) {
  const [closed, setClosed] = useState(false);
  if (closed) return null;
  return (
    <div class="ann" id="ann">
      <div class="wrap ann-in">
        <Gift />
        <span>{text}</span>
        <a href="#signup">{cta}</a>
        <button class="ann-x" onClick={() => setClosed(true)} aria-label="close">
          <X />
        </button>
      </div>
    </div>
  );
}
