fix spacing

This commit is contained in:
Mathew Pareles 2025-01-16 17:09:38 -08:00
parent ddd9cf857f
commit c02f1de758
3 changed files with 10 additions and 7 deletions

View file

@ -9,23 +9,21 @@ import { VoidCodeEditor, VoidCodeEditorProps } from '../util/inputs.js';
export const BlockCode = ({ buttonsOnHover, ...codeEditorProps }: { buttonsOnHover?: React.ReactNode } & VoidCodeEditorProps) => {
const isSingleLine = !codeEditorProps.initValue.includes('\n')
return (
<>
<div className={`relative group w-full overflow-hidden`}>
<div className="relative group w-full overflow-hidden">
{buttonsOnHover === null ? null : (
<div className="z-[1] absolute top-0 right-0 opacity-0 group-hover:opacity-100 duration-200">
<div className={`flex space-x-2 ${isSingleLine ? '' : 'p-2'}`}>
<div className={`z-[1] absolute top-0 right-0 opacity-0 group-hover:opacity-100 duration-200 ${isSingleLine ? 'h-full flex items-center' : ''
}`}>
<div className={`flex space-x-1 ${isSingleLine ? 'pr-2' : 'p-2'}`}>
{buttonsOnHover}
</div>
</div>
)}
<VoidCodeEditor {...codeEditorProps} />
</div>
</>
)

View file

@ -28,7 +28,7 @@ export const Sidebar = ({ className }: { className: string }) => {
<div
// default background + text styles for sidebar
className={`
w-full h-full py-2
w-full h-full
bg-void-bg-2
text-void-fg-1
`}

View file

@ -422,6 +422,11 @@ const ChatBubble = ({ chatMessage, isLoading }: {
// edit mode state
const [isEditMode, setIsEditMode] = useState(false)
if (!chatMessage.content) { // don't show if empty
return null
}
let chatbubbleContents: React.ReactNode
if (role === 'user') {