mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 04:45:08 +03:00
## Context Small adjustments to wildcard routes - Header logo to be consistent with other layouts - Before: <img width="463" height="172" alt="image" src="https://github.com/user-attachments/assets/217bb9d8-d4f9-4482-8c40-5f0c49afeee6" /> - After: <img width="523" height="229" alt="image" src="https://github.com/user-attachments/assets/707dd541-f0ab-4023-ba25-e244eb7c3e7a" /> - Project wildcard route list view to be consistent with org/[slug] page - project list shouldn't take full height if there's no need to, scroll behaviour should be on the page - Before: <img width="1224" height="868" alt="image" src="https://github.com/user-attachments/assets/6ff9f8a3-9f68-40a0-9a0b-e60fbef603cd" /> - After: <img width="1230" height="477" alt="image" src="https://github.com/user-attachments/assets/91d65969-9457-49f9-9ce2-d3befc4576ad" /> Co-authored-by: Ali Waseem <waseema393@gmail.com>
107 lines
2.9 KiB
TypeScript
107 lines
2.9 KiB
TypeScript
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
|
|
import { BoxPlus } from 'icons'
|
|
import { Plus } from 'lucide-react'
|
|
import Link from 'next/link'
|
|
import {
|
|
Button,
|
|
Card,
|
|
Skeleton,
|
|
Table,
|
|
TableBody,
|
|
TableCell,
|
|
TableHead,
|
|
TableHeader,
|
|
TableRow,
|
|
} from 'ui'
|
|
import { EmptyStatePresentational } from 'ui-patterns'
|
|
|
|
import { ShimmeringCard } from './ShimmeringCard'
|
|
import { HomeIcon } from '@/components/layouts/ProjectLayout/LayoutHeader/HomeIcon'
|
|
|
|
export const Header = () => {
|
|
return (
|
|
<div className="flex items-center border-default border-b px-4 py-3.5">
|
|
<HomeIcon />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export const LoadingTableView = () => {
|
|
return (
|
|
<Card>
|
|
<Table>
|
|
<TableHeader>
|
|
<TableRow>
|
|
<TableHead>Project</TableHead>
|
|
<TableHead>Status</TableHead>
|
|
<TableHead>Compute</TableHead>
|
|
<TableHead>Region</TableHead>
|
|
<TableHead>Created</TableHead>
|
|
</TableRow>
|
|
</TableHeader>
|
|
<TableBody>
|
|
{[...Array(3)].map((_, i) => (
|
|
<TableRow key={i}>
|
|
<TableCell>
|
|
<Skeleton className="bg-surface-400 h-4 w-32"></Skeleton>
|
|
</TableCell>
|
|
<TableCell>
|
|
<Skeleton className="bg-surface-400 h-4 w-16"></Skeleton>
|
|
</TableCell>
|
|
<TableCell>
|
|
<Skeleton className="bg-surface-400 h-4 w-20"></Skeleton>
|
|
</TableCell>
|
|
<TableCell>
|
|
<Skeleton className="bg-surface-400 h-4 w-20"></Skeleton>
|
|
</TableCell>
|
|
<TableCell>
|
|
<Skeleton className="bg-surface-400 h-4 w-24"></Skeleton>
|
|
</TableCell>
|
|
</TableRow>
|
|
))}
|
|
</TableBody>
|
|
</Table>
|
|
</Card>
|
|
)
|
|
}
|
|
|
|
export const LoadingCardView = () => {
|
|
return (
|
|
<ul className="w-full mx-auto grid grid-cols-1 gap-4 sm:grid-cols-1 md:grid-cols-1 lg:grid-cols-2 xl:grid-cols-3">
|
|
<ShimmeringCard />
|
|
<ShimmeringCard />
|
|
</ul>
|
|
)
|
|
}
|
|
|
|
export const NoProjectsState = ({ slug }: { slug: string }) => {
|
|
const projectCreationEnabled = useIsFeatureEnabled('projects:create')
|
|
|
|
return (
|
|
<EmptyStatePresentational
|
|
icon={BoxPlus}
|
|
title="Create a project"
|
|
description="Launch a complete backend built on Postgres."
|
|
>
|
|
{projectCreationEnabled && (
|
|
<Button size="tiny" type="default" asChild icon={<Plus />}>
|
|
<Link href={`/new/${slug}`}>New project</Link>
|
|
</Button>
|
|
)}
|
|
</EmptyStatePresentational>
|
|
)
|
|
}
|
|
|
|
export const NoOrganizationsState = () => {
|
|
return (
|
|
<EmptyStatePresentational
|
|
title="Create an organization"
|
|
description="Manage your team and projects in one place."
|
|
>
|
|
<Button size="tiny" type="primary" asChild icon={<Plus />}>
|
|
<Link href="/new">New organization</Link>
|
|
</Button>
|
|
</EmptyStatePresentational>
|
|
)
|
|
}
|