Files
supabase/apps/studio/components/interfaces/Settings/Integrations/IntegrationsSettings.tsx
Alaister YoungandJoshen Lim 44c8f849ba feat: disable org features (#37991)
* feat: disable logs features

* feat: disable project homepage features

* feat: disable org features

* Nit fixes

* reenable billing

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-08-19 12:03:29 +08:00

61 lines
2.2 KiB
TypeScript

import Link from 'next/link'
import SidePanelVercelProjectLinker from 'components/interfaces/Organization/IntegrationSettings/SidePanelVercelProjectLinker'
import { ScaffoldContainer, ScaffoldDivider } from 'components/layouts/Scaffold'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { useProjectByRefQuery, useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { BASE_PATH } from 'lib/constants'
import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, WarningIcon } from 'ui'
import GitHubSection from './GithubIntegration/GithubSection'
import VercelSection from './VercelIntegration/VercelSection'
export const IntegrationImageHandler = ({ title }: { title: 'vercel' | 'github' }) => {
return (
<img
className="border rounded-lg shadow w-full sm:w-48 mt-6 border-body"
src={`${BASE_PATH}/img/integrations/covers/${title}-cover.png`}
alt={`${title} cover`}
/>
)
}
const IntegrationSettings = () => {
const { data: project } = useSelectedProjectQuery()
const { data: parentProject } = useProjectByRefQuery(project?.parent_project_ref)
const isBranch = project?.parent_project_ref !== undefined
const showVercelIntegration = useIsFeatureEnabled('integrations:vercel')
return (
<>
{isBranch && (
<ScaffoldContainer>
<Alert_Shadcn_ variant="default" className="mt-6">
<WarningIcon />
<AlertTitle_Shadcn_>
You are currently on a preview branch of your project
</AlertTitle_Shadcn_>
<AlertDescription_Shadcn_>
To adjust your project's integration settings, you may return to your{' '}
<Link href={`/project/${parentProject?.ref}/settings/general`} className="text-brand">
main branch
</Link>
.
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
</ScaffoldContainer>
)}
<GitHubSection />
{showVercelIntegration && (
<>
<ScaffoldDivider />
<VercelSection isProjectScoped={true} />
<SidePanelVercelProjectLinker />
</>
)}
</>
)
}
export default IntegrationSettings