import React from 'react';
import { Button } from '@theorchard/suite-components';
import { Link } from 'react-router-dom';

export interface LinkButtonProps {
    buttonSize?: 'sm' | 'md' | 'lg';
    disabled?: boolean;
    label: string;
    target: string;
    variant?: string;
}

export const LinkButton: React.FC<LinkButtonProps> = ({
    buttonSize = 'lg',
    disabled = false,
    label,
    target,
    variant = 'primary',
}) => {
    let size: any;
    let color: any;

    if (variant !== 'default') color = { variant };

    if (buttonSize !== 'md') size = { size: buttonSize };

    return (
        <Link to={target}>
            <Button disabled={disabled} {...color} {...size}>
                {label}
            </Button>
        </Link>
    );
};
