Files
supabase/apps/studio/components/interfaces/Billing/NoProjectsOnPaidOrgInfo.tsx
Gildas Garcia b30db91d71 chore: cleanup UI patterns exports (#47406)
## 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
2026-06-30 09:23:17 +02:00

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>
}
/>
)
}