import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';
import {
  EmptyStateUniDriver,
  TextButtonUniDriver,
} from '@wix/design-system/dist/testkit/unidriver';
import RequestIdUniDriver from '../RequestId/RequestId.uni.driver';

export function ToolbarCollectionErrorStateUniDriver(
  base: UniDriver,
  body: UniDriver,
) {
  return {
    ...EmptyStateUniDriver(base, body),

    getRequestIdUniDriver: () =>
      RequestIdUniDriver(body.$('[data-hook="request-id"]'), body),

    getButtonByDataHook: (dataHook: string) =>
      TextButtonUniDriver(base.$(`[data-hook="${dataHook}"]`), body),

    getRetryButton: () =>
      TextButtonUniDriver(
        base.$('[data-hook="collection-error-state-action-button"]'),
        body,
      ),
  };
}
