"use client";

import { Button as FlowbiteButton } from "flowbite-react";
import { FC } from "react";
import { twMerge } from "tailwind-merge";

type ButtonProps = {
  size?: string;
  isProcessing?: boolean;
  disabled?: boolean;
  color?: string;
  children?: any;
  onClick?: Function;
  className?: string;
  buttonType?: any;
};

const Button: FC<ButtonProps> = ({
  size = "sm",
  isProcessing = false,
  disabled = false,
  children = "click me",
  color = "blue",
  className = "",
  buttonType = "button",
  onClick = () => {},
}) => {
  return (
    <FlowbiteButton
      size={size}
      isProcessing={isProcessing}
      disabled={disabled}
      color={color}
      className={twMerge(className)}
      onClick={() => onClick()}
      type={buttonType}
    >
      {children}
    </FlowbiteButton>
  );
};

export default Button;
