mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 11:25:06 +03:00
## Problem We now export components under a subpath in ui-patterns to avoid barrel files as they slow down every tools (from IDE to linters, etc.) and may also affect bundles our users have to download. ## Solution - Remove the UI patterns index file - Fix invalid impors
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import Link from 'next/link'
|
|
import { Admonition } from 'ui-patterns/admonition'
|
|
|
|
import { useOrgProjectsInfiniteQuery } from '@/data/projects/org-projects-infinite-query'
|
|
import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'
|
|
|
|
const EXCLUDED_PLANS = ['free', 'platform', 'enterprise']
|
|
|
|
export const NoProjectsOnPaidOrgInfo = () => {
|
|
const { data: organization } = useSelectedOrganizationQuery()
|
|
const isEligible = organization != null && !EXCLUDED_PLANS.includes(organization.plan.id ?? '')
|
|
|
|
const { data } = useOrgProjectsInfiniteQuery(
|
|
{ slug: organization?.slug },
|
|
{ enabled: isEligible }
|
|
)
|
|
const projectCount = data?.pages[0].pagination.count ?? 0
|
|
|
|
if (!isEligible || projectCount > 0) return null
|
|
|
|
return (
|
|
<Admonition
|
|
type="default"
|
|
title={`Your organization is on the ${organization.plan.name} plan with no projects running`}
|
|
description={
|
|
<div className="max-w-full! prose text-sm">
|
|
The monthly fees for the paid plan still apply. To cancel your subscription, head over to
|
|
your{' '}
|
|
<Link href={`/org/${organization?.slug}/billing`}>organization billing settings</Link>
|
|
</div>
|
|
}
|
|
/>
|
|
)
|
|
}
|