mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-06 23:35:34 +00:00
* 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>
48 lines
1.1 KiB
TypeScript
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>
|
|
);
|
|
}
|