import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';
import { baseUniDriverFactory } from '../../unidriver';
import { CollectionEmptyStateUniDriver } from '../EmptyState/CollectionEmptyState.uni.driver';
import { LoaderUniDriver } from '@wix/design-system/dist/testkit/unidriver';
import { ToolbarCollectionErrorStateUniDriver } from '../ErrorState/ToolbarCollectionErrorState.uni.driver';

export function NestedTableRowPlaceholderStatesUniDriver(
  base: UniDriver,
  body: UniDriver,
) {
  return {
    ...baseUniDriverFactory(base),
    getEmptyState: () =>
      CollectionEmptyStateUniDriver(base.$('[data-hook="empty-state"]'), body),
    getErrorState: () =>
      ToolbarCollectionErrorStateUniDriver(
        base.$('[data-hook="error-state"]'),
        body,
      ),
    getLoadingState: () =>
      LoaderUniDriver(base.$('[data-hook="loading-state"]'), body),
  };
}
