import { IconBrandDiscord, IconBrandGithub, IconBrandNpm, IconShieldCheck, } from '@tabler/icons-react'; import type { ComponentType } from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router'; import { PROJECT_DISPLAY_NAME, Wordmark } from '@/components/Logo'; import { useDocsVisibility } from '@/hooks/api'; import { isDocsHrefVisible } from '@/lib/docs-links'; /* * Footer for the template's homepage. The generic scaffold footer * (components/sections/footer.tsx) stays for other pages; this one lays out the * brand lockup on the left, Product and Company link columns, and a Developers * column of icon buttons (GitHub, npm, Discord, security policy). Links to * docs routes that are switched off are filtered out. */ interface DevService { label: string; href: string; Icon: ComponentType<{ className?: string }>; } interface LinkColumn { title: string; links: { text: string; href: string }[]; } function FooterLink({ text, href }: { text: string; href: string }) { const className = 'w-fit text-sm text-muted-foreground transition-colors hover:text-primary'; return href.startsWith('/') && !href.startsWith('//') ? ( {text} ) : ( {text} ); } export function VibecarbonFooter() { const { t } = useTranslation(); const docsVisibility = useDocsVisibility(); const devServices: DevService[] = [ { label: 'GitHub', href: 'https://github.com/hyperformant/vibecarbon/', Icon: IconBrandGithub }, { label: 'npm', href: 'https://www.npmjs.com/package/vibecarbon', Icon: IconBrandNpm }, { label: 'Discord', href: 'https://discord.gg/up8Z9sX6M6', Icon: IconBrandDiscord }, { label: t('landing.footer.security'), href: 'https://github.com/hyperformant/vibecarbon/blob/main/SECURITY.md', Icon: IconShieldCheck, }, ]; const columns: LinkColumn[] = [ { title: t('landing.footer.groups.product'), links: [ { text: t('landing.footer.pricing'), href: '/pricing' }, { text: t('landing.footer.blog'), href: '/blog' }, { text: t('landing.footer.changelog'), href: '/changelog' }, { text: t('landing.footer.userDocs'), href: '/docs' }, { text: t('landing.footer.apiDocs'), href: '/api/docs' }, ], }, { title: t('landing.footer.groups.company'), links: [ { text: t('landing.footer.contact'), href: '/contact' }, { text: t('landing.footer.privacy'), href: '/privacy' }, { text: t('landing.footer.terms'), href: '/terms' }, ], }, ]; const visibleColumns = columns .map((column) => ({ ...column, links: column.links.filter((link) => isDocsHrefVisible(link.href, docsVisibility)), })) .filter((column) => column.links.length > 0); return ( ); }