dashboard improvements

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-05-08 10:05:32 +02:00
parent 66d75e8a7a
commit 63c30caa7a
4 changed files with 10 additions and 10 deletions

View File

@@ -16,12 +16,7 @@ interface Props {
const ListDashboardsServer = async ({ projectId }: Props) => { const ListDashboardsServer = async ({ projectId }: Props) => {
const dashboards = await getDashboardsByProjectId(projectId); const dashboards = await getDashboardsByProjectId(projectId);
return ( return <ListDashboards dashboards={dashboards} />;
<>
{dashboards.length > 0 && <HeaderDashboards />}
<ListDashboards dashboards={dashboards} />
</>
);
}; };
export default withSuspense(ListDashboardsServer, FullPageLoadingState); export default withSuspense(ListDashboardsServer, FullPageLoadingState);

View File

@@ -20,7 +20,6 @@ import {
Pencil, Pencil,
PieChartIcon, PieChartIcon,
PlusIcon, PlusIcon,
SquarePenIcon,
Trash, Trash,
} from 'lucide-react'; } from 'lucide-react';
import Link from 'next/link'; import Link from 'next/link';
@@ -86,14 +85,13 @@ export function ListDashboards({ dashboards }: ListDashboardsProps) {
<Card key={item.id} hover> <Card key={item.id} hover>
<div> <div>
<Link <Link
prefetch={false}
href={`/${organizationSlug}/${projectId}/dashboards/${item.id}`} href={`/${organizationSlug}/${projectId}/dashboards/${item.id}`}
className="flex flex-col p-4 @container" className="flex flex-col p-4 @container"
> >
<div> <div>
<div className="font-medium">{item.name}</div> <div className="font-medium">{item.name}</div>
<div className="text-xs text-muted-foreground"> <div className="text-xs text-muted-foreground">
{item.updatedAt.toLocaleString()} {format(item.updatedAt, 'HH:mm · MMM d')}
</div> </div>
</div> </div>
<div <div

View File

@@ -1,6 +1,7 @@
import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout';
import ListDashboardsServer from './list-dashboards'; import ListDashboardsServer from './list-dashboards';
import { HeaderDashboards } from './list-dashboards/header';
interface PageProps { interface PageProps {
params: { params: {
@@ -15,6 +16,7 @@ export default function Page({
return ( return (
<> <>
<PageLayout title="Dashboards" organizationSlug={organizationSlug} /> <PageLayout title="Dashboards" organizationSlug={organizationSlug} />
<HeaderDashboards />
<ListDashboardsServer projectId={projectId} /> <ListDashboardsServer projectId={projectId} />
</> </>
); );

View File

@@ -16,7 +16,12 @@ export function FullPageEmptyState({
className, className,
}: FullPageEmptyStateProps) { }: FullPageEmptyStateProps) {
return ( return (
<div className={cn('flex items-center justify-center p-4', className)}> <div
className={cn(
'flex items-center justify-center p-4 text-center',
className
)}
>
<div className="flex w-full max-w-xl flex-col items-center justify-center p-8"> <div className="flex w-full max-w-xl flex-col items-center justify-center p-8">
<div className="mb-6 flex h-24 w-24 items-center justify-center rounded-full bg-background shadow-sm"> <div className="mb-6 flex h-24 w-24 items-center justify-center rounded-full bg-background shadow-sm">
<Icon size={60} strokeWidth={1} /> <Icon size={60} strokeWidth={1} />