import { useState } from 'react' import { useForm } from 'react-hook-form' type FooterLink = { name: string href: string comingSoon?: boolean } type FooterMenu = { title: string links: FooterLink[] } const FOOTER_MENUS: FooterMenu[] = [ { title: 'Company', links: [ { name: 'Vision', href: '/', comingSoon: true }, { name: 'Handbook', href: '/handbook' }, { name: 'Community', href: 'https://discord.com/invite/FTk2MvZwJH' }, { name: 'Careers', href: 'https://menlo.bamboohr.com/careers' }, ], }, { title: 'Resources', links: [ { name: 'Blog', href: '/blog' }, { name: 'Docs', href: '/docs' }, { name: 'Changelog', href: '/changelog' }, { name: 'API Reference', href: '/api-reference' }, { name: 'Jan Exam', href: '/', comingSoon: true }, ], }, { title: 'Store', links: [ { name: 'Model Store', href: '/', comingSoon: true }, { name: 'MCP Store', href: '/', comingSoon: true }, ], }, ] export default function Footer() { const [formMessage, setFormMessage] = useState('') const { register, handleSubmit, reset } = useForm<{ email: string }>() const onSubmit = (data: { email: string }) => { const { email } = data const options = { method: 'POST', body: JSON.stringify({ updateEnabled: false, email, listIds: [13], }), } if (email) { fetch('https://brevo.jan.ai/', options) .then((response) => response.json()) .then((response) => { if (response.id) { setFormMessage('You have successfully joined our newsletter') } else { setFormMessage(response.message) } reset() setTimeout(() => { setFormMessage('') }, 5000) }) .catch((err) => console.error(err)) } } return ( ) }