temp fix for code issue on nodeToolbar

This commit is contained in:
anovazzi1 2024-02-08 19:41:18 -03:00
commit 7d3c21e608

View file

@ -197,18 +197,20 @@ export default function NodeToolbarComponent({
}; };
const [openModal, setOpenModal] = useState(false); const [openModal, setOpenModal] = useState(false);
const hasCode = Object.keys(data.node!.template).includes("code");
return ( return (
<> <>
<div className="w-26 h-10"> <div className="w-26 h-10">
<span className="isolate inline-flex rounded-md shadow-sm"> <span className="isolate inline-flex rounded-md shadow-sm">
{hasCode && (
<ShadTooltip content="Code" side="top"> <ShadTooltip content="Code" side="top">
<button <button
className="relative inline-flex items-center rounded-l-md bg-background px-2 py-2 text-foreground shadow-md ring-1 ring-inset ring-ring transition-all duration-500 ease-in-out hover:bg-muted focus:z-10" className="relative inline-flex items-center rounded-l-md bg-background px-2 py-2 text-foreground shadow-md ring-1 ring-inset ring-ring transition-all duration-500 ease-in-out hover:bg-muted focus:z-10"
onClick={() => { onClick={() => {
setOpenModal(!openModal); setOpenModal(!openModal);
}} }}
data-testid="delete-button-modal" data-testid="code-button-modal"
> >
<div className="hidden"> <div className="hidden">
<CodeAreaComponent <CodeAreaComponent
@ -230,11 +232,13 @@ export default function NodeToolbarComponent({
<IconComponent name="Code2" className="h-4 w-4" /> <IconComponent name="Code2" className="h-4 w-4" />
</button> </button>
</ShadTooltip> </ShadTooltip>
)}
<ShadTooltip content="Duplicate" side="top"> <ShadTooltip content="Duplicate" side="top">
<button <button
className={classNames( className={classNames(
"relative -ml-px inline-flex items-center bg-background px-2 py-2 text-foreground shadow-md ring-1 ring-inset ring-ring transition-all duration-500 ease-in-out hover:bg-muted focus:z-10" "relative -ml-px inline-flex items-center bg-background px-2 py-2 text-foreground shadow-md ring-1 ring-inset ring-ring transition-all duration-500 ease-in-out hover:bg-muted focus:z-10",
hasCode ? "" : "rounded-l-md"
)} )}
onClick={(event) => { onClick={(event) => {
event.preventDefault(); event.preventDefault();