fix(studio): use hook for org in NoProjectsOnPaidOrgInfo (#44572)

Follow-up to #44562 – the org prop wasn't actually being passed in, so
`NoProjectsOnPaidOrgInfo` was always returning null. Switched to
`useSelectedOrganizationQuery` hook instead.

## To test

- Go to an org on a paid plan with no projects
- Verify the admonition banner appears on the general settings page

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Simplified component architecture by replacing prop-based organization
retrieval with hook-based approach, reducing component coupling and
improving maintainability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-04-06 19:05:24 +09:00
1 parent e7bec24021
commit a020be54c0
1 file changed
+3 -6
@@ -2,15 +2,12 @@ import Link from 'next/link'
import { Admonition } from 'ui-patterns'
import { useOrgProjectsInfiniteQuery } from '@/data/projects/org-projects-infinite-query'
import type { Organization } from '@/types'
interface NoProjectsOnPaidOrgInfoProps {
organization?: Organization
}
import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'
const EXCLUDED_PLANS = ['free', 'platform', 'enterprise']
export const NoProjectsOnPaidOrgInfo = ({ organization }: NoProjectsOnPaidOrgInfoProps) => {
export const NoProjectsOnPaidOrgInfo = () => {
const { data: organization } = useSelectedOrganizationQuery()
const isEligible = organization != null && !EXCLUDED_PLANS.includes(organization.plan.id ?? '')
const { data } = useOrgProjectsInfiniteQuery(