feat: refactor layout and introduce workspace panel and fix some bugs

This commit is contained in:
Dominic Elm
2024-07-12 17:25:41 +02:00
parent 5fa2ee53cc
commit ab9d59a30d
16 changed files with 297 additions and 211 deletions

View File

@@ -3,17 +3,22 @@ import { workspaceStore } from '~/lib/stores/workspace';
interface ArtifactProps {
messageId: string;
onClick?: () => void;
}
export function Artifact({ messageId, onClick }: ArtifactProps) {
export function Artifact({ messageId }: ArtifactProps) {
const artifacts = useStore(workspaceStore.artifacts);
const artifact = artifacts[messageId];
return (
<button className="flex border rounded-lg overflow-hidden items-stretch bg-gray-50/25 w-full" onClick={onClick}>
<div className="border-r flex items-center px-6 bg-gray-50">
<button
className="flex border rounded-lg overflow-hidden items-stretch bg-gray-50/25 w-full"
onClick={() => {
const showWorkspace = workspaceStore.showWorkspace.get();
workspaceStore.showWorkspace.set(!showWorkspace);
}}
>
<div className="border-r flex items-center px-6 bg-gray-100/50">
{!artifact?.closed ? (
<div className="i-svg-spinners:90-ring-with-bg scale-130"></div>
) : (