import { ButtonPanelMode } from "@core/Store/ButtonPanel.Store";
import style from "./style.module.css";

export interface ButtonPanelItemProps {
    icon: React.ReactNode;
    text: string;
    onClick: () => void;
    mode?: ButtonPanelMode;
}
export default function ButtonPanelItem(props: ButtonPanelItemProps): React.ReactElement {
    const getClassName = () => {
        if (props.mode === "icon") {
            return style.buttonPanelIconItem;
        }

        return style.buttonPanelButtonItem;
    };

    return (
        <>
            <a className={getClassName()} onClick={props.onClick}>
                {props.icon}
                <div>{props.text}</div>
            </a>
        </>
    );
}
