"use client";
import { FC, PropsWithChildren } from "react";
import clsx from "clsx";
import styles from "./style.module.scss";

/**
 * @description 自定义button按钮
 * @param {any} children 插槽内容
 * @param {boolean} active 是否高亮
 * @param {() => void} callbackFun 回调方法
 */
export interface ButtonOwnProps {
    children?: any;
    active?: boolean;
    callbackFun?: () => void;
    [props: string]: any
}

const ButtonOwn: FC<PropsWithChildren<ButtonOwnProps>> = ({children = '', active = false, callbackFun}) => {
    const divClassName = clsx({
        [styles.button]: true,
        [styles.active]: active,
    });
    return (
        <div className={divClassName} onClick={callbackFun}>{children}</div>
    );
};

export default ButtonOwn;
