mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 21:05:06 +03:00
* basic fixes * improve form contents * fix border clipping * remove redundant animation and classes * polish confirm org * improvements * fix header rounding * prevent password managers from appearing * Fix the handling of token when redirecting back. Use nuqs for getting URL params. Simplify some logic. * Minor fix to the useEffect for org name. --------- Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
53 lines
1.7 KiB
TypeScript
53 lines
1.7 KiB
TypeScript
import AlertError from 'components/ui/AlertError'
|
|
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,
|
|
isLoading: isOrganizationsLoading,
|
|
isError: isOrganizationsError,
|
|
error: organizationsError,
|
|
} = useOrganizationsQuery()
|
|
|
|
return (
|
|
<>
|
|
{slug !== '_' && (
|
|
<Admonition type="danger">
|
|
The selected organization does not exist or you don't have permission to access it.{' '}
|
|
{slug ? (
|
|
<>
|
|
Contact the owner or administrator to create a new project in the <code>{slug}</code>{' '}
|
|
organization.
|
|
</>
|
|
) : (
|
|
<>Contact the owner or administrator to create a new project.</>
|
|
)}
|
|
</Admonition>
|
|
)}
|
|
|
|
<h3 className="text-sm">Select an 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 && (
|
|
<AlertError error={organizationsError} subject="Failed to load organizations" />
|
|
)}
|
|
{isOrganizationsSuccess &&
|
|
organizations?.map((org) => (
|
|
<OrganizationCard key={org.slug} organization={org} href={`/new/${org.slug}`} />
|
|
))}
|
|
</div>
|
|
</>
|
|
)
|
|
}
|