Merge pull request #25 from sunmorgan/mdev

This commit is contained in:
Andrew Pareles 2024-09-18 09:42:55 -07:00 committed by GitHub
commit 085e622c1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -241,6 +241,11 @@ const Sidebar = () => {
}, [messageStream])
//Clear code selection
const clearSelection = () => {
setSelection(null);
};
return <>
<div className="flex flex-col h-full w-full">
<div className="flex-grow overflow-y-auto overflow-x-hidden p-4">
@ -259,8 +264,17 @@ const Sidebar = () => {
<FilesSelector files={files} setFiles={setFiles} />
{/* selected code */}
{!selection?.selectionStr ? null
: <BlockCode text={selection?.selectionStr} disableApplyButton={true} />
}
: (
<div className="relative">
<button
onClick={clearSelection}
className="absolute top-2 right-2 text-white hover:text-gray-300 z-10"
>
X
</button>
<BlockCode text={selection.selectionStr} disableApplyButton={true} />
</div>
)}
</div>
<form
ref={formRef}