import { Check, Mail } from 'lucide-react' import Link from 'next/link' import { Button, IconDiscord, Separator } from 'ui' import { NO_PROJECT_MARKER } from './SupportForm.utils' import { useProjectDetailQuery } from '@/data/projects/project-detail-query' import { useProfile } from '@/lib/profile' interface SuccessProps { sentCategory?: string selectedProject?: string onFinish?: () => void finishLabel?: string } export const Success = ({ sentCategory = '', selectedProject = NO_PROJECT_MARKER, onFinish, finishLabel = 'Finish', }: SuccessProps) => { const { profile } = useProfile() const respondToEmail = profile?.primary_email ?? 'your email' const { data: project } = useProjectDetailQuery( { ref: selectedProject }, { enabled: selectedProject !== NO_PROJECT_MARKER } ) const projectName = project ? project.name : 'No specific project' const categoriesToShowAdditionalResources = ['Problem', 'Unresponsive', 'Performance'] return (
{selectedProject !== NO_PROJECT_MARKER && ( <> Your ticket has been logged for the project{' '} {projectName} with project ID:{' '} {selectedProject}. > )}{' '} We will reach out to you at{' '} {respondToEmail}.
Our Discord community can help with code-related issues. Many questions are answered in minutes.