Files
supabase/apps/studio/components/interfaces/Organization/OrgNotFound.tsx
T
Ivan Vasilov 0d5be306ef chore: Bump React Query to v5 (#40174)
* Bump the deps, refactor deprecated code.

* Migrate keepPreviousData usage.

* Migrate all uses of InfiniteQuery.

* Fix refetchInterval in queries.

* Migrate all use of isLoading to isPending in mutations.

* Fix accessing location in claim-project.

* Fix a bug in duplicate query keys.

* Migrate all queries to use isPending.

* Revert "Fix accessing location in claim-project."

This reverts commit 2a07df64b5.

* Revert the rss.xml file to master.
2025-12-10 10:10:29 +01:00

62 lines
1.9 KiB
TypeScript

import { useOrganizationsQuery } from 'data/organizations/organizations-query'
import { Skeleton } from 'ui'
import { Admonition } from 'ui-patterns/admonition'
import { OrganizationCard } from './OrganizationCard'
export const OrgNotFound = ({ slug }: { slug?: string }) => {
const {
data: organizations,
isSuccess: isOrganizationsSuccess,
isPending: isOrganizationsLoading,
isError: isOrganizationsError,
error: organizationsError,
} = useOrganizationsQuery()
return (
<>
{slug !== '_' && (
<Admonition
type="destructive"
title="Organization not found"
description={
<>
{slug ? (
<>
The organization <code className="text-code-inline">{slug}</code>{' '}
</>
) : (
<>This organization </>
)}
does not exist or you do not have permission to access to it. Contact the the owner if
you believe this is a mistake.
</>
}
/>
)}
<h3 className="text-sm">Select a different organization to create your new project in</h3>
<div className="grid gap-2 grid-cols-2">
{isOrganizationsLoading && (
<>
<Skeleton className="h-[62px] rounded-md" />
<Skeleton className="h-[62px] rounded-md" />
<Skeleton className="h-[62px] rounded-md" />
</>
)}
{isOrganizationsError && (
<Admonition
type="destructive"
title="Failed to load organizations"
description={organizationsError?.message}
/>
)}
{isOrganizationsSuccess &&
organizations?.map((org) => (
<OrganizationCard key={org.slug} organization={org} href={`/new/${org.slug}`} />
))}
</div>
</>
)
}