mirror of
https://github.com/supabase/supabase.git
synced 2026-10-18 15:49:09 +03:00
* Add lucide-react to docs (to make the autocomplete work). * Migrate the docs app icons. * Migrate the ui-patterns. * Remove the old icons from ui package. * Migrate the www app from react-feather icons. * Migrate all of studio icons. * Migrate the only component in design-system. * Fix an old import in ui package. Revert an import in docs app. * Fix some pages in www. * Remove unneeded files used in generation of icons. * Fix a prettier error. * Fix more issues in www. * Fix an issue in Log Date picker. * Replace all string sizes with number sizes because the icons grew in some cases. * Fix more imports in security page. * Fix an extra import. * Remove the size prop from all icons if they're in a button and they match the button size. * Minor fixes for docs and www. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
51 lines
1.6 KiB
TypeScript
51 lines
1.6 KiB
TypeScript
import { Info } from 'lucide-react'
|
|
import Link from 'next/link'
|
|
|
|
import InformationBox from 'components/ui/InformationBox'
|
|
import { useProjectsQuery } from 'data/projects/projects-query'
|
|
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
|
|
import type { Organization } from 'types'
|
|
|
|
interface NoProjectsOnPaidOrgInfoProps {
|
|
organization?: Organization
|
|
}
|
|
|
|
const NoProjectsOnPaidOrgInfo = ({ organization }: NoProjectsOnPaidOrgInfoProps) => {
|
|
const { data: allProjects } = useProjectsQuery({})
|
|
const projectCount =
|
|
allProjects?.filter((project) => project.organization_id === organization?.id).length ?? 0
|
|
|
|
const { data: orgSubscription } = useOrgSubscriptionQuery({ orgSlug: organization?.slug })
|
|
|
|
if (
|
|
projectCount > 0 ||
|
|
orgSubscription?.plan === undefined ||
|
|
orgSubscription.plan.id === 'free' ||
|
|
orgSubscription.plan.id === 'enterprise'
|
|
)
|
|
return null
|
|
|
|
return (
|
|
<InformationBox
|
|
defaultVisibility={true}
|
|
hideCollapse
|
|
title={`Your organization is on the ${orgSubscription.plan.name} plan with no projects running`}
|
|
icon={<Info strokeWidth={2} />}
|
|
description={
|
|
<div>
|
|
The monthly fees for the paid plan still apply. To cancel your subscription, head over to
|
|
your{' '}
|
|
<Link
|
|
href={`/org/${organization?.slug}/billing`}
|
|
className="text-sm text-green-900 transition hover:text-green-1000"
|
|
>
|
|
organization billing settings .
|
|
</Link>
|
|
</div>
|
|
}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export default NoProjectsOnPaidOrgInfo
|