Correction for merge
This commit is contained in:
parent
1f9fe951fe
commit
96ae8916d5
2 changed files with 69 additions and 43 deletions
|
|
@ -1,31 +1,49 @@
|
|||
import { PlusIcon, XMarkIcon } from "@heroicons/react/24/solid";
|
||||
import { useContext } from "react";
|
||||
import { TabsContext } from "../../../../contexts/tabsContext";
|
||||
import { classNames } from "../../../../utils";
|
||||
|
||||
export default function TabComponent({ selected, flow, id, onClick}) {
|
||||
const { removeFlow, flows } = useContext(TabsContext);
|
||||
return (
|
||||
<>
|
||||
export default function TabComponent({ selected, flow, onClick }) {
|
||||
const { removeFlow } = useContext(TabsContext);
|
||||
return (
|
||||
<>
|
||||
{flow ? (
|
||||
selected ? (
|
||||
<button
|
||||
className="px-4 my-2 mt-3 border-l border-gray-300 -ml-px"
|
||||
!selected ? (
|
||||
<div
|
||||
className="flex justify-between select-none w-36 items-center px-4 my-2 mt-3 border-x border-gray-300 -ml-px"
|
||||
onClick={onClick}
|
||||
>
|
||||
{flow.name}
|
||||
</button>
|
||||
<button
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
removeFlow(flow.id);
|
||||
}}
|
||||
>
|
||||
<XMarkIcon className="h-4" />
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<div className="bg-white pt-3 pointer-events-none border border-b-0 border-gray-300 px-4 py-2 rounded-t-xl">
|
||||
<div className="bg-white flex select-none justify-between w-36 items-center pt-3 border border-b-0 border-gray-300 px-4 py-2 rounded-t-xl -ml-px">
|
||||
{flow.name}
|
||||
<button
|
||||
onClick={() => {
|
||||
removeFlow(flow.id);
|
||||
}}
|
||||
>
|
||||
<XMarkIcon className="h-4" />
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
) : (
|
||||
<div className="h-full py-2 pt-3 flex justify-center items-center">
|
||||
<button className="px-3 h-full border-l border-gray-300 -ml-px">
|
||||
<button
|
||||
className="px-3 h-full border-gray-300 -ml-px"
|
||||
onClick={onClick}
|
||||
>
|
||||
<PlusIcon className="h-5" />
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue