chore: rename blocks to artifacts (#793)

This commit is contained in:
Jeremy 2025-02-13 08:25:57 -08:00 committed by GitHub
parent 01f589b603
commit 81f909ac3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 473 additions and 473 deletions

View file

@ -0,0 +1,29 @@
import { memo } from 'react';
import { CrossIcon } from './icons';
import { Button } from './ui/button';
import { initialArtifactData, useArtifact } from '@/hooks/use-artifact';
function PureArtifactCloseButton() {
const { setArtifact } = useArtifact();
return (
<Button
variant="outline"
className="h-fit p-2 dark:hover:bg-zinc-700"
onClick={() => {
setArtifact((currentArtifact) =>
currentArtifact.status === 'streaming'
? {
...currentArtifact,
isVisible: false,
}
: { ...initialArtifactData, status: 'idle' },
);
}}
>
<CrossIcon size={18} />
</Button>
);
}
export const ArtifactCloseButton = memo(PureArtifactCloseButton, () => true);