qwen-code/packages/web-shell/client/components/WorkspaceUnavailableState.tsx
ytahdn 79ae054bb8
feat(web-shell): modernize multi-workspace sidebar (#6804)
* feat(web-shell): modernize multi-workspace sidebar

* fix(web-shell): address sidebar review feedback

* fix(web-shell): address remaining review feedback

---------

Co-authored-by: ytahdn <ytahdn@gmail.com>
2026-07-13 11:45:20 +00:00

48 lines
1.1 KiB
TypeScript

import { FolderXIcon } from 'lucide-react';
import type { ReactNode } from 'react';
import { Button } from './ui/button';
import {
Empty,
EmptyContent,
EmptyDescription,
EmptyHeader,
EmptyMedia,
EmptyTitle,
} from './ui/empty';
interface WorkspaceUnavailableStateProps {
title: string;
description: string;
actionLabel: string;
onAction: () => void;
theme?: 'dark' | 'light';
icon?: ReactNode;
}
export function WorkspaceUnavailableState({
title,
description,
actionLabel,
onAction,
theme,
icon,
}: WorkspaceUnavailableStateProps) {
return (
<div
data-web-shell-root
data-web-shell-shadcn
className={`flex min-h-48 w-full items-center justify-center p-4 ${theme === 'dark' ? 'dark' : ''}`}
>
<Empty className="border">
<EmptyHeader>
<EmptyMedia variant="icon">{icon ?? <FolderXIcon />}</EmptyMedia>
<EmptyTitle>{title}</EmptyTitle>
<EmptyDescription>{description}</EmptyDescription>
</EmptyHeader>
<EmptyContent>
<Button onClick={onAction}>{actionLabel}</Button>
</EmptyContent>
</Empty>
</div>
);
}