VercelIntegrationWindowLayout.tsx36 lines · main
| 1 | import { useParams } from 'common' |
| 2 | import { PropsWithChildren } from 'react' |
| 3 | import InlineSVG from 'react-inlinesvg' |
| 4 | |
| 5 | import IntegrationWindowLayout from './IntegrationWindowLayout' |
| 6 | import { BASE_PATH } from '@/lib/constants' |
| 7 | import { useIntegrationInstallationSnapshot } from '@/state/integration-installation' |
| 8 | |
| 9 | const VERCEL_ICON = ( |
| 10 | <div className="bg-black shadow-sm rounded-sm p-1 w-8 h-8 flex justify-center items-center text-white"> |
| 11 | <InlineSVG src={`${BASE_PATH}/img/icons/vercel-icon.svg`} title="Vercel Icon" className="w-4" /> |
| 12 | </div> |
| 13 | ) |
| 14 | |
| 15 | const VercelIntegrationWindowLayout = ({ children }: PropsWithChildren<{}>) => { |
| 16 | const { externalId } = useParams() |
| 17 | |
| 18 | const snapshot = useIntegrationInstallationSnapshot() |
| 19 | |
| 20 | const title = externalId |
| 21 | ? 'Briven + Vercel Deploy Button' |
| 22 | : 'Briven + Vercel Integration Marketplace Connector' |
| 23 | |
| 24 | return ( |
| 25 | <IntegrationWindowLayout |
| 26 | title={title} |
| 27 | integrationIcon={VERCEL_ICON} |
| 28 | loading={snapshot.loading} |
| 29 | docsHref="https://supabase.com/partners/integrations/vercel" |
| 30 | > |
| 31 | {children} |
| 32 | </IntegrationWindowLayout> |
| 33 | ) |
| 34 | } |
| 35 | |
| 36 | export default VercelIntegrationWindowLayout |