mirror of
https://github.com/supabase/supabase.git
synced 2026-10-19 08:09:11 +03:00
* Add Vercel Marketplace login flow page * Add alternative Vercel Marketplace flow with for popup windows * Automatically redirect user to project after Vercel Marketplace login * added PartnerIcon * Update partner-icon.tsx * refactor partner icon * hide invoices when on vercel marketplace * vercel marketplace – payment method / billing address / tax numbers | empty states * add tooltip to memebers * always show invoices tab * Update InvoicesSettings.tsx * add partner id * update cta urls * add vercel managed org banner * add billing coming soon warning * remove sign-in-vercel-marketplace routes * re-enable plan upgrades * Update api.d.ts * Fix type checking * fix vercel links * improve ts --------- Co-authored-by: Kamil Ogórek <kamil.ogorek@gmail.com> Co-authored-by: Alaister Young <a@alaisteryoung.com> Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com> Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
55 lines
1.5 KiB
TypeScript
55 lines
1.5 KiB
TypeScript
import { ExternalLink } from 'lucide-react'
|
|
|
|
import { useVercelRedirectQuery } from 'data/integrations/vercel-redirect-query'
|
|
import { Alert_Shadcn_, AlertTitle_Shadcn_, Button } from 'ui'
|
|
import PartnerIcon from './PartnerIcon'
|
|
|
|
interface PartnerManagedResourceProps {
|
|
partner: 'vercel-marketplace' | 'aws-marketplace'
|
|
resource: string
|
|
cta?: {
|
|
installationId?: string
|
|
path?: string
|
|
}
|
|
}
|
|
|
|
export const PARTNER_TO_NAME = {
|
|
'vercel-marketplace': 'Vercel Marketplace',
|
|
'aws-marketplace': 'AWS Marketplace',
|
|
} as const
|
|
|
|
function PartnerManagedResource({ partner, resource, cta }: PartnerManagedResourceProps) {
|
|
const ctaEnabled = cta !== undefined
|
|
|
|
const { data, isLoading, isError } = useVercelRedirectQuery(
|
|
{
|
|
installationId: cta?.installationId,
|
|
},
|
|
{
|
|
enabled: ctaEnabled,
|
|
}
|
|
)
|
|
|
|
const ctaUrl = (data?.url ?? '') + (cta?.path ?? '')
|
|
|
|
return (
|
|
<Alert_Shadcn_ className="flex flex-col items-center gap-4">
|
|
<PartnerIcon organization={{ managed_by: partner }} showTooltip={false} size="large" />
|
|
|
|
<AlertTitle_Shadcn_ className="text-lg">
|
|
{resource} are managed by {PARTNER_TO_NAME[partner]}.
|
|
</AlertTitle_Shadcn_>
|
|
|
|
{ctaEnabled && (
|
|
<Button asChild iconRight={<ExternalLink />} disabled={isLoading || isError}>
|
|
<a href={ctaUrl} target="_blank" rel="noopener noreferrer">
|
|
View {resource} on {PARTNER_TO_NAME[partner]}
|
|
</a>
|
|
</Button>
|
|
)}
|
|
</Alert_Shadcn_>
|
|
)
|
|
}
|
|
|
|
export default PartnerManagedResource
|