import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';
import { baseUniDriverFactory } from '../../../../unidriver';

export function MediaGalleryViewUniDriver(base: UniDriver, _body: UniDriver) {
  return {
    ...baseUniDriverFactory(base),
    hasAvatarGroup: () =>
      base
        .$('[data-hook="media-gallery-view"] [data-hook="avatar-item"]')
        .exists(),
    isEmpty: async () => {
      const count = await base
        .$('[data-hook="media-gallery-view"]')
        .$$('[data-hook="avatar-item"]')
        .count();
      return count === 0;
    },
  };
}
