import React from 'react';

interface MemoToggleProps {
  onToggle: (visible: boolean) => void;
  className?: string;
}

export default function MemoToggle({ onToggle, className }: MemoToggleProps) {
  const [visible, setVisible] = React.useState(true);

  const handleClick = () => {
    const newVisible = !visible;
    setVisible(newVisible);
    onToggle(newVisible);
  };

  return (
    <button
      type="button"
      onClick={handleClick}
      className={className}
    >
      {visible ? '隐藏提示' : '显示提示'}
    </button>
  );
} 