import { SegmentedToggleUniDriver } from '@wix/design-system/dist/testkit/unidriver';
import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';

export function TableGridSwitchButtonUniDriver(
  base: UniDriver,
  body: UniDriver,
) {
  const getSegmented = () => SegmentedToggleUniDriver(base, body);

  return {
    ...getSegmented(),
    clickTableButton: () => base.$$(`[data-hook="toggle-icon"]`).get(1).click(),
    clickGridButton: () => base.$$(`[data-hook="toggle-icon"]`).get(0).click(),
  };
}

export default TableGridSwitchButtonUniDriver;
