Fixed buttons on nodes being draggable
This commit is contained in:
parent
4fcd7027ad
commit
20b7b6acd6
3 changed files with 37 additions and 31 deletions
|
|
@ -4,6 +4,7 @@ import { TypeModal } from "../../constants/enums";
|
||||||
import GenericModal from "../../modals/genericModal";
|
import GenericModal from "../../modals/genericModal";
|
||||||
import { PromptAreaComponentType } from "../../types/components";
|
import { PromptAreaComponentType } from "../../types/components";
|
||||||
import IconComponent from "../genericIconComponent";
|
import IconComponent from "../genericIconComponent";
|
||||||
|
import { Button } from "../ui/button";
|
||||||
|
|
||||||
export default function PromptAreaComponent({
|
export default function PromptAreaComponent({
|
||||||
field_name,
|
field_name,
|
||||||
|
|
@ -36,30 +37,32 @@ export default function PromptAreaComponent({
|
||||||
nodeClass={nodeClass}
|
nodeClass={nodeClass}
|
||||||
setNodeClass={setNodeClass}
|
setNodeClass={setNodeClass}
|
||||||
>
|
>
|
||||||
<div className="flex w-full items-center gap-3">
|
<Button unstyled className="w-full">
|
||||||
<span
|
<div className="flex w-full items-center gap-3">
|
||||||
id={id}
|
<span
|
||||||
data-testid={id}
|
|
||||||
className={
|
|
||||||
editNode
|
|
||||||
? "input-edit-node input-dialog"
|
|
||||||
: (disabled ? "input-disable text-ring " : "") +
|
|
||||||
" primary-input text-muted-foreground"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{value !== "" ? value : "Type your prompt here..."}
|
|
||||||
</span>
|
|
||||||
{!editNode && (
|
|
||||||
<IconComponent
|
|
||||||
id={id}
|
id={id}
|
||||||
name="ExternalLink"
|
data-testid={id}
|
||||||
className={
|
className={
|
||||||
"icons-parameters-comp shrink-0" +
|
editNode
|
||||||
(disabled ? " text-ring" : " hover:text-accent-foreground")
|
? "input-edit-node input-dialog"
|
||||||
|
: (disabled ? "input-disable text-ring " : "") +
|
||||||
|
" primary-input text-muted-foreground"
|
||||||
}
|
}
|
||||||
/>
|
>
|
||||||
)}
|
{value !== "" ? value : "Type your prompt here..."}
|
||||||
</div>
|
</span>
|
||||||
|
{!editNode && (
|
||||||
|
<IconComponent
|
||||||
|
id={id}
|
||||||
|
name="ExternalLink"
|
||||||
|
className={
|
||||||
|
"icons-parameters-comp shrink-0" +
|
||||||
|
(disabled ? " text-ring" : " hover:text-accent-foreground")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</Button>
|
||||||
</GenericModal>
|
</GenericModal>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { TypeModal } from "../../constants/enums";
|
||||||
import GenericModal from "../../modals/genericModal";
|
import GenericModal from "../../modals/genericModal";
|
||||||
import { TextAreaComponentType } from "../../types/components";
|
import { TextAreaComponentType } from "../../types/components";
|
||||||
import IconComponent from "../genericIconComponent";
|
import IconComponent from "../genericIconComponent";
|
||||||
|
import { Button } from "../ui/button";
|
||||||
import { Input } from "../ui/input";
|
import { Input } from "../ui/input";
|
||||||
|
|
||||||
export default function TextAreaComponent({
|
export default function TextAreaComponent({
|
||||||
|
|
@ -46,15 +47,17 @@ export default function TextAreaComponent({
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
{!editNode && (
|
{!editNode && (
|
||||||
<IconComponent
|
<Button unstyled>
|
||||||
strokeWidth={1.5}
|
<IconComponent
|
||||||
id={id}
|
strokeWidth={1.5}
|
||||||
name="ExternalLink"
|
id={id}
|
||||||
className={
|
name="ExternalLink"
|
||||||
"icons-parameters-comp shrink-0" +
|
className={
|
||||||
(disabled ? " text-ring" : " hover:text-accent-foreground")
|
"icons-parameters-comp shrink-0" +
|
||||||
}
|
(disabled ? " text-ring" : " hover:text-accent-foreground")
|
||||||
/>
|
}
|
||||||
|
/>
|
||||||
|
</Button>
|
||||||
)}
|
)}
|
||||||
</GenericModal>
|
</GenericModal>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ export default function GenericModal({
|
||||||
open={modalOpen}
|
open={modalOpen}
|
||||||
setOpen={setModalOpen}
|
setOpen={setModalOpen}
|
||||||
>
|
>
|
||||||
<BaseModal.Trigger disable={disabled}>{children}</BaseModal.Trigger>
|
<BaseModal.Trigger disable={disabled} asChild>{children}</BaseModal.Trigger>
|
||||||
<BaseModal.Header
|
<BaseModal.Header
|
||||||
description={(() => {
|
description={(() => {
|
||||||
switch (myModalTitle) {
|
switch (myModalTitle) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue