Files
supabase/apps/studio/components/interfaces/Support/SupportAccessToggle.tsx
T
Joshen Lim 09a1f431bc Mass update for all lucide icon imports to use the component with Icon suffix (#51659)
## Context

This is largely just a mechanical change here:
Opting to use lucide icons with the `Icon` suffix across all icon
imports within `studio`
- so that it’s clearer which components are icons + reduces the
possibility of name collision with our own components
- e.g <User /> vs <UserIcon />

Also added a eslint rule for this:
<img width="1069" height="167" alt="image"
src="https://github.com/user-attachments/assets/7f36f443-5ca2-4bf6-8d22-86e774513bfc"
/>

And updated `AGENTS.md` as such:
```
Icons come from `lucide-react`, always imported with the `Icon` suffix (`import { CheckIcon, Trash2Icon } from 'lucide-react'`) — never the bare names (`Check`) or `Check as CheckIcon` aliases (lint-enforced).
```
2026-10-14 12:56:55 +02:00

94 lines
3.4 KiB
TypeScript

// End of third-party imports
import { ChevronRightIcon } from 'lucide-react'
import Link from 'next/link'
import type { UseFormReturn } from 'react-hook-form'
import {
Badge,
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
FormControl,
FormField,
Switch,
} from 'ui'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import type { SupportFormValues } from './SupportForm.schema'
interface SupportAccessToggleProps {
form: UseFormReturn<SupportFormValues>
align?: 'left' | 'right'
className?: string
}
export function SupportAccessToggle({ form, align = 'left', className }: SupportAccessToggleProps) {
return (
<FormField
name="allowSupportAccess"
control={form.control}
render={({ field }) => {
return (
<FormItemLayout
hideMessage
className={className}
layout="flex"
align={align}
label={
<div className="flex items-center gap-x-2">
<span className="text-foreground">Allow support access to your project</span>
<Badge>Recommended</Badge>
</div>
}
description={
<div className="flex flex-col">
<span className="text-foreground-light">
Human support and AI diagnostic access.
</span>
<Collapsible className="mt-2">
<CollapsibleTrigger
className={
'group flex items-center gap-x-1 group-data-open:text-foreground hover:text-foreground transition'
}
>
<ChevronRightIcon
size={14}
className="transition-all group-data-open:rotate-90 text-foreground-muted -ml-1"
/>
<span className="text-sm">More information</span>
</CollapsibleTrigger>
<CollapsibleContent className="text-sm text-foreground-light mt-2 space-y-2">
<p>
By enabling this, you grant permission for our support team to access your
project temporarily and, if applicable, to use AI tools to assist in
diagnosing and resolving issues. This access may involve analyzing database
configurations, query performance, and other relevant data to expedite
troubleshooting and enhance support accuracy.
</p>
<p>
We are committed to maintaining strict data privacy and security standards in
all support activities.{' '}
<Link
href="https://supabase.com/privacy"
target="_blank"
rel="noreferrer"
className="text-foreground-light underline hover:text-foreground transition"
>
Privacy Policy
</Link>
</p>
</CollapsibleContent>
</Collapsible>
</div>
}
>
<FormControl>
<Switch size="large" checked={field.value} onCheckedChange={field.onChange} />
</FormControl>
</FormItemLayout>
)
}}
/>
)
}