add markdown to description
This commit is contained in:
parent
49bdbef548
commit
39c7494f40
1 changed files with 14 additions and 4 deletions
|
|
@ -37,6 +37,7 @@ import getFieldTitle from "../utils/get-field-title";
|
||||||
import sortFields from "../utils/sort-fields";
|
import sortFields from "../utils/sort-fields";
|
||||||
import ParameterComponent from "./components/parameterComponent";
|
import ParameterComponent from "./components/parameterComponent";
|
||||||
import { useShortcutsStore } from "../../stores/shortcuts";
|
import { useShortcutsStore } from "../../stores/shortcuts";
|
||||||
|
import Markdown from "react-markdown";
|
||||||
|
|
||||||
export default function GenericNode({
|
export default function GenericNode({
|
||||||
data,
|
data,
|
||||||
|
|
@ -561,9 +562,11 @@ export default function GenericNode({
|
||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
{/* increase height!! */}
|
||||||
<div className="generic-node-desc">
|
<div className="generic-node-desc">
|
||||||
{showNode && nameEditable && inputDescription ? (
|
{showNode && nameEditable && inputDescription ? (
|
||||||
<Textarea
|
<Textarea
|
||||||
|
className="nowheel min-h-40"
|
||||||
autoFocus
|
autoFocus
|
||||||
onBlur={() => {
|
onBlur={() => {
|
||||||
setInputDescription(false);
|
setInputDescription(false);
|
||||||
|
|
@ -608,7 +611,7 @@ export default function GenericNode({
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"nodoubleclick generic-node-desc-text cursor-text truncate-multiline word-break-break-word",
|
"nodoubleclick generic-node-desc-text cursor-text word-break-break-word",
|
||||||
(data.node?.description === "" ||
|
(data.node?.description === "" ||
|
||||||
!data.node?.description) &&
|
!data.node?.description) &&
|
||||||
nameEditable
|
nameEditable
|
||||||
|
|
@ -621,9 +624,16 @@ export default function GenericNode({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{(data.node?.description === "" || !data.node?.description) &&
|
{(data.node?.description === "" || !data.node?.description) &&
|
||||||
nameEditable
|
nameEditable ? (
|
||||||
? "Double Click to Edit Description"
|
"Double Click to Edit Description"
|
||||||
: data.node?.description}
|
) : (
|
||||||
|
<Markdown
|
||||||
|
className="markdown prose flex flex-col text-primary word-break-break-word
|
||||||
|
dark:prose-invert"
|
||||||
|
>
|
||||||
|
{String(data.node?.description)}
|
||||||
|
</Markdown>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue