import React from 'react';
import type { ReactNode } from 'react';
import './BackButton.css';

interface BackButtonProps {
  children?: ReactNode;
  onClick?: () => void;
  disabled?: boolean;
  className?: string;
  title?: string;
}

export const BackButton: React.FC<BackButtonProps> = ({
  children = '← Back',
  onClick,
  disabled = false,
  className = '',
  title,
}) => {
  return (
    <button
      type="button"
      className={`back-button ${className}`.trim()}
      onClick={onClick}
      disabled={disabled}
      title={title}
    >
      {children}
    </button>
  );
};