style(lists): refresh pagination and loading states

This commit is contained in:
2026-04-29 02:05:39 +03:30
parent e4b1dcf3c0
commit 5082dab99e
5 changed files with 240 additions and 89 deletions

View File

@@ -10,8 +10,9 @@ import {
canWorkspace,
type WorkspaceRole,
} from '../lib/permissions';
import FilterBar from '../components/FilterBar';
import { Button } from '../components/ui/button';
import FilterBar from '../components/FilterBar';
import { ListPageSkeleton } from '../components/ListPageSkeleton';
import { Button } from '../components/ui/button';
import { Input } from '../components/ui/input';
import { Card, CardContent, CardTitle } from '../components/ui/card';
import { Pagination } from '../components/Pagination';
@@ -116,7 +117,8 @@ export default function Workspaces() {
};
return (
<div className="mx-auto max-w-7xl space-y-5 p-4 md:p-6">
<div className="mx-auto flex min-h-full max-w-7xl flex-col p-4 md:p-6">
<div className="flex flex-1 flex-col gap-5">
<div className="rounded-3xl border border-slate-200 bg-white p-5 shadow-sm dark:border-slate-800 dark:bg-slate-900 sm:p-6">
<div className="flex items-start justify-between gap-4">
<div>
@@ -146,14 +148,10 @@ export default function Workspaces() {
</div>
{isLoading ? (
<div className="rounded-3xl border border-slate-200 bg-white p-12 shadow-sm dark:border-slate-800 dark:bg-slate-900">
<div className="text-center text-slate-500 dark:text-slate-400">
<div className="animate-pulse">{t.workspace?.loading || 'Loading...'}</div>
</div>
</div>
<ListPageSkeleton variant="list" />
) : (
<div className="space-y-6">
<div className="flex flex-col gap-4">
<div className="flex flex-1 flex-col gap-6">
<div className="flex flex-1 flex-col gap-4">
{workspaces.map((workspace) => {
const canDeleteWorkspace = canWorkspace(workspace.my_role, WORKSPACE_DELETE);
const canEditWorkspace = canWorkspace(workspace.my_role, WORKSPACE_EDIT);
@@ -220,7 +218,7 @@ export default function Workspaces() {
})}
{workspaces.length === 0 && (
<div className="rounded-3xl border-2 border-dashed border-slate-200 bg-white py-16 shadow-sm dark:border-slate-800 dark:bg-slate-900">
<div className="flex flex-1 rounded-3xl border-2 border-dashed border-slate-200 bg-white py-16 shadow-sm dark:border-slate-800 dark:bg-slate-900">
<div className="flex flex-col items-center justify-center">
<p className="text-slate-500 dark:text-slate-400 font-medium">{t.workspace?.emptyState || 'No workspaces found'}</p>
</div>
@@ -237,10 +235,11 @@ export default function Workspaces() {
pageSizeOptions={[10, 20, 50]}
/>
</div>
)}
{deleteModal.workspace && (
<Modal
)}
</div>
{deleteModal.workspace && (
<Modal
isOpen={deleteModal.isOpen}
onClose={() => {
setDeleteModal({ isOpen: false, workspace: null });