import { ActiveTab } from "../../constants/activeTab"
import type { ButtonComponent } from "../../types/component"
import { ButtonGeneralProperties } from "./buttonGeneral"
import { ButtonActionProperties } from "./buttonAction"
import type { Screen } from "../../types/screen"
import type { Table } from "../../types/table"
import type { ComponentActions } from "../../hooks/useComponent"



interface ButtonPropertyProps {
    component: ButtonComponent
    index: number
    activeTab: number
    screens: Screen[]
    curScreenIndex: number,
    tables: Table[],
    componentActions: ComponentActions
}

export function ButtonProperty({
    component,
    index,
    activeTab,
    screens,
    curScreenIndex,
    tables,
    componentActions
}: ButtonPropertyProps) {

    if (activeTab === ActiveTab.GENERAL)
        return <ButtonGeneralProperties
            component={component}
            index={index}
            updateComponent={componentActions.updateComponent}
        />

    if (activeTab === ActiveTab.STYLE)
        return <div></div>

    if (activeTab === ActiveTab.ACTION)
        return <ButtonActionProperties
            component={component}
            screens={screens}
            curScreenIndex={curScreenIndex}
            updateComponent={componentActions.updateComponent}
            activateSelectMode={componentActions.activateSelectMode}
            setSelectComponentListener={componentActions.setSelectComponentListener}
            tables={tables}
        />

}