remove no content paradigm
This commit is contained in:
parent
49b6663ef2
commit
34edfc7353
3 changed files with 15 additions and 14 deletions
|
|
@ -88,7 +88,6 @@ interface ExpandableToolbarPreviewProps {
|
|||
isSelected?: boolean;
|
||||
/** Content to display in the preview */
|
||||
children: React.ReactNode;
|
||||
noContent: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -182,7 +181,7 @@ export function ExpandableToolbarPreview(props: ExpandableToolbarPreviewProps) {
|
|||
</div>
|
||||
<div className="flex items-center gap-1">
|
||||
<HeaderButtonWithToolTip text={hidden ? "Show" : "Hide"}>
|
||||
{!props.noContent &&
|
||||
{!!props.children &&
|
||||
(hidden ? (
|
||||
<EyeIcon className="h-2.5 w-2.5" />
|
||||
) : (
|
||||
|
|
@ -203,7 +202,7 @@ export function ExpandableToolbarPreview(props: ExpandableToolbarPreviewProps) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{!hidden && !props.noContent && (
|
||||
{!hidden && !!props.children && (
|
||||
<ContentContainer expanded={isExpanded}>
|
||||
<ScrollableContent
|
||||
ref={contentRef}
|
||||
|
|
|
|||
|
|
@ -66,11 +66,12 @@ export const CodeBlockPreview = ({
|
|||
onDelete={() => deleteNode()}
|
||||
borderColor={selected ? vscBadgeBackground : undefined}
|
||||
onTitleClick={handleTitleClick}
|
||||
noContent={!content}
|
||||
>
|
||||
<StyledMarkdownPreview
|
||||
source={`${fence}${getMarkdownLanguageTagForFile(item.name)} ${item.description}\n${content}\n${fence}`}
|
||||
/>
|
||||
{!content ? null : (
|
||||
<StyledMarkdownPreview
|
||||
source={`${fence}${getMarkdownLanguageTagForFile(item.name)} ${item.description}\n${content}\n${fence}`}
|
||||
/>
|
||||
)}
|
||||
</ExpandableToolbarPreview>
|
||||
</NodeViewWrapper>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -41,14 +41,15 @@ export const PromptBlockPreview = ({
|
|||
itemId={item.id.itemId}
|
||||
onDelete={handleDelete}
|
||||
onTitleClick={handleTitleClick}
|
||||
noContent={!item.content}
|
||||
>
|
||||
<div
|
||||
className="whitespace-pre-wrap px-3 py-1 text-xs"
|
||||
contentEditable={false}
|
||||
>
|
||||
{item.content}
|
||||
</div>
|
||||
{!item.content ? null : (
|
||||
<div
|
||||
className="whitespace-pre-wrap px-3 py-1 text-xs"
|
||||
contentEditable={false}
|
||||
>
|
||||
{item.content}
|
||||
</div>
|
||||
)}
|
||||
</ExpandableToolbarPreview>
|
||||
</NodeViewWrapper>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue