import React, { ReactNode } from "react";
import { Button, ButtonProps, Group } from "@mantine/core";

interface Props extends ButtonProps {
    children?: ReactNode;
    onClick?: () => void;
}

const InlineShippingButton = ({ children, onClick, ...props }: Props) => {
    return (
        <Button
            variant="default"
            onClick={(e: React.MouseEvent<HTMLButtonElement>) => {
                e.stopPropagation();
                onClick && onClick();
            }}
            {...props}
        >
            <Group gap="sm" wrap={"nowrap"}>
                {children}
            </Group>
        </Button>
    );
};

export default InlineShippingButton;
