import { useParams } from 'common' import { ChevronRight } from 'lucide-react' import { useTheme } from 'next-themes' import Link from 'next/link' import { cn } from 'ui' import { useSendEventMutation } from '@/data/telemetry/send-event-mutation' import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization' import { BASE_PATH } from '@/lib/constants' interface ExampleProjectProps { title: string description: string url: string framework?: string iconUrl?: string } export const ExampleProject = ({ framework, title, description, url, iconUrl, }: ExampleProjectProps) => { const { resolvedTheme } = useTheme() const { ref: projectRef } = useParams() const { data: org } = useSelectedOrganizationQuery() const { mutate: sendEvent } = useSendEventMutation() const iconImgSrc = iconUrl ? iconUrl : !!framework ? `${BASE_PATH}/img/libraries/${framework.toLowerCase()}${ ['expo', 'nextjs'].includes(framework.toLowerCase()) ? resolvedTheme?.includes('dark') ? '-dark' : '' : '' }-icon.svg` : '' return ( sendEvent({ action: 'example_project_card_clicked', properties: { cardTitle: title }, groups: { project: projectRef ?? 'Unknown', organization: org?.slug ?? 'Unknown' }, }) } >
{`${framework}
{title}

{description}

) }