import { ArrowRightIcon, ArrowUpRightIcon } from '@expo/styleguide-icons'; import type { AnchorHTMLAttributes, ComponentType, HTMLAttributes, ReactNode } from 'react'; import { A, DEMI, P } from '~/ui/components/Text'; type BoxLinkProps = AnchorHTMLAttributes & { title: string; description: ReactNode; testID?: string; Icon?: ComponentType>; imageUrl?: string; }; export function BoxLink({ title, description, href, testID, Icon, imageUrl }: BoxLinkProps) { const isExternal = Boolean(href && href.startsWith('http')); const ArrowIcon = isExternal ? ArrowUpRightIcon : ArrowRightIcon; return (
{Icon && (
)} {imageUrl && Icon}
{title}

{description}

); }