--- import { Icon } from 'astro-icon/components' import { cn } from '../lib/cn' import { pluralize } from '../lib/pluralize' import { createPageUrl } from '../lib/urls' import Button from './Button.astro' import ServiceCard from './ServiceCard.astro' import type { ServicesFiltersObject } from '../pages/index.astro' import type { ComponentProps, HTMLAttributes } from 'astro/types' type Props = HTMLAttributes<'div'> & { hasDefaultFilters?: boolean services: ComponentProps['service'][] | undefined currentPage?: number total: number pageSize: number sortSeed?: string filters: ServicesFiltersObject includeScams: boolean } const { services, hasDefaultFilters = false, currentPage = 1, total, pageSize, sortSeed, class: className, filters, includeScams, ...divProps } = Astro.props const hasScams = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing filters.verification.includes('VERIFICATION_FAILED') || includeScams const hasSomeScam = !!services?.some((service) => service.verificationStatus.includes('VERIFICATION_FAILED')) const hasCommunityContributed = filters.verification.includes('COMMUNITY_CONTRIBUTED') const hasSomeCommunityContributed = !!services?.some((service) => service.verificationStatus.includes('COMMUNITY_CONTRIBUTED') ) const totalPages = Math.ceil(total / pageSize) || 1 ---
{total.toLocaleString()} {pluralize('result', total)} Loading...
{ hasScams && hasCommunityContributed && (
Results {hasSomeScam || hasSomeCommunityContributed ? 'include' : 'may include'} SCAMS or community-contributed services.
) } { hasScams && !hasCommunityContributed && (
Results {hasSomeScam ? 'include' : 'may include'} SCAM services
) } { !hasScams && hasCommunityContributed && (
Results {hasSomeCommunityContributed ? 'include' : 'may include'} unverified community-contributed services, some might be scams.
) } { !services || services.length === 0 ? (

No services found

Try adjusting your filters to find more services

Clear filters
) : ( <>
{services.map((service, i) => ( ))}
Loading more services...
) }