/**
 * View Component: FavoriteBar
 * Floating bottom bar showing current selection count and actions.
 * Appears only when at least 1 item is favorited.
 *
 * Props:
 *   count: number
 *   onClear: () => void
 *   onExport: () => void
 */

function FavoriteBar({ count, onClear }) {
  return (
    <div className={`fav-bar ${count > 0 ? 'visible' : ''}`}>
      <span className="fav-bar-count">
        已选 <span>{count}</span> 篇素材
      </span>
      <button className="fav-bar-action">确认选材</button>
      <button className="fav-bar-clear" onClick={onClear}>
        清空
      </button>
    </div>
  );
}

window.FavoriteBar = FavoriteBar;
