import { Button } from '@douyinfe/semi-ui';

type VehicleOptionErrorProps = {
  message: string;
  onRetry: () => void | Promise<unknown>;
};

export function VehicleOptionError({ message, onRetry }: VehicleOptionErrorProps) {
  return <div className="v2-vehicle-option-error" role="alert">
    <span>{message}</span>
    <Button
      size="small"
      theme="light"
      type="danger"
      onMouseDown={(event) => event.preventDefault()}
      onClick={() => void onRetry()}
    >
      重试
    </Button>
  </div>;
}
