import React, {FC} from "react";
import {Button} from "./cards/Button";
import {__, CouponsPlus} from "../globals";
import {useAtom} from "jotai/index";
import {ModelAtom} from "./atoms";

export type LegacyModelSelectorButtonProps = {
}

export const LegacyModelSelectorButton: FC<LegacyModelSelectorButtonProps> = ({}) => {
    const [model, switchModel] = useAtom(ModelAtom)

    return <Button preset={'gray'} size={'small'} onClick={() => switchModel(model === 'tree' ? 'rows' : 'tree')}>
        {model === 'tree' ? __('Use Rows (legacy)') : __('Switch to Tree')}
    </Button>;
}
