Files
supabase/apps/studio/components/interfaces/Support/Success.tsx
Joshen Lim d11bd4997e Revert "Support form Assistant" (#46194)
Reverts supabase/supabase#45861

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **New Features**
* Support form now returns to home view upon completion within the help
panel.
* Success screen conditionally displays community (Discord) section for
specific issue categories.

* **Bug Fixes**
  * Improved project selection logic in support form initialization.

* **Style**
  * Updated support form label text for clarity.
* Redesigned success screen layout with updated styling and separators.

* **Removed Features**
  * Removed support assistant follow-up card from success screen.
  * Removed support request message parsing from AI responses.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46194?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-21 14:28:40 +07:00

96 lines
3.3 KiB
TypeScript

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 (
<div className="mt-10 max-w-[620px] flex flex-col items-center space-y-4">
<div className="relative">
<Mail strokeWidth={1.5} size={32} className="text-brand" />
<div className="absolute -bottom-1 -right-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-brand">
<Check strokeWidth={4} size={16} className="text-contrast" />
</div>
</div>
<div className="flex items-center flex-col space-y-2 text-center p-4">
<h3 className="text-xl">Support request sent</h3>
<p className="text-sm text-foreground-light text-balance">
{selectedProject !== NO_PROJECT_MARKER && (
<>
Your ticket has been logged for the project{' '}
<span className="text-foreground font-medium">{projectName}</span> with project ID:{' '}
<span className="text-foreground font-medium">{selectedProject}</span>.
</>
)}{' '}
We will reach out to you at{' '}
<span className="text-foreground font-medium">{respondToEmail}</span>.
</p>
</div>
{categoriesToShowAdditionalResources.includes(sentCategory) && (
<>
<div className="my-10! w-full">
<Separator />
</div>
<div className="flex flex-col items-center px-12 space-y-2 text-center">
<h4 className="text-lg font-normal">Tap into our community</h4>
<p className="text-sm text-foreground-light text-balance">
Our Discord community can help with code-related issues. Many questions are answered
in minutes.
</p>
</div>
<Button
asChild
type="default"
icon={<IconDiscord size={16} fill="hsl(var(--background-default))" />}
>
<Link href={'https://discord.supabase.com/'} target="_blank">
Join us on Discord
</Link>
</Button>
</>
)}
<div className="mt-10! w-full">
<Separator />
</div>
<div className="w-full pb-4 px-4 flex items-center justify-end">
{onFinish ? (
<Button type="default" onClick={onFinish}>
{finishLabel}
</Button>
) : (
<Button asChild type="default">
<Link href="/">{finishLabel}</Link>
</Button>
)}
</div>
</div>
)
}