--- import type { Section, Service } from '../../types/Service'; import { slugify } from '@utils/fetch-data'; import { parseMarkdown, formatLink } from '@utils/parse-markdown'; import FontAwesome from '@components/form/FontAwesome.svelte'; import SaveListing from '@components/things/SaveListing.svelte'; import ServiceIcon from '@components/things/ServiceIcon.astro'; interface Props { service: Service; parentSection: Section; categoryName: string; privacyPolicyLink: string | null; } const { service, parentSection, categoryName, privacyPolicyLink } = Astro.props; const { name, description, url, github, tosdrId, iosApp, androidApp, discordInvite, subreddit, icon, followWith, links, securityAudited, openSource, acceptsCrypto, } = service; const catSlug = slugify(categoryName); const secSlug = slugify(parentSection.name); const otherServices = parentSection.services.filter( (s: Service) => s.name !== name, ); const infoLinks = [ url && { label: 'Homepage', href: url, text: formatLink(url) }, github && { label: 'GitHub', href: `https://github.com/${github}`, text: `github.com/${github}`, }, tosdrId && { label: 'Privacy', href: privacyPolicyLink, text: formatLink(privacyPolicyLink || ''), }, iosApp && { label: 'iOS App', href: iosApp, text: formatLink(iosApp) }, androidApp && { label: 'Android App', href: `https://play.google.com/store/apps/details?id=${androidApp}`, text: `play.google.com/.../${androidApp}`, }, discordInvite && { label: 'Discord', href: `https://discord.com/invite/${discordInvite}`, text: discordInvite, }, subreddit && { label: 'Subreddit', href: `https://reddit.com/r/${subreddit}`, text: `r/${subreddit}`, }, url && { label: 'Web info', href: `https://web-check.xyz/check/${formatLink(url)}`, text: `web-check.xyz/check/${formatLink(url).split('/')[0]}`, }, ...(links || []).map((link) => ({ label: link.title, href: link.url, text: link.url, })), ].filter(Boolean) as { label: string; href: string | null; text: string }[]; const highlights = [ securityAudited && { icon: 'securityAudited', text: 'Security Audited', cls: 'great', title: `${name} has been security audited by an accredited auditor, with results published publicly`, }, acceptsCrypto && { icon: 'cryptoAccepted', text: 'Crypto Payments Accepted', cls: 'great', title: `${name} accepts anonymous payment methods`, }, securityAudited === false && { icon: 'notSecurityAudited', text: 'No Security Audit', cls: 'warning', title: `${name} has not been audited`, }, openSource === false && { icon: 'closedSource', text: 'Not Open Source', cls: 'warning', title: `${name} is not open source`, }, (openSource || (github && openSource !== false)) && { icon: 'openSource', text: 'Open Source', cls: 'great', title: `${name} is open source`, }, ].filter(Boolean) as { icon: string; text: string; cls: string; title: string; }[]; --- {name} {formatLink(url)} {followWith} Awesome Privacy ➔ {categoryName} ➔ {parentSection.name} ➔ {name} { infoLinks.map((link) => ( {link.label}: {link.text} )) } { (parentSection.alternativeTo || []).length > 0 && ( Avoid {(parentSection.alternativeTo || []).map((alt: string) => ( {alt} ))} ) } { otherServices.length > 0 && ( Also Consider {otherServices.map((s: Service) => ( {s.name} ))} ) } { highlights.map((h) => ( {h.text} )) }