delete tabs working
This commit is contained in:
parent
0b5414cfd3
commit
41e5052da1
4 changed files with 45 additions and 21 deletions
|
|
@ -1,16 +1,24 @@
|
|||
import { XMarkIcon } from "@heroicons/react/24/solid";
|
||||
import { useContext } from "react";
|
||||
import { TabsContext } from "../../../../contexts/tabsContext";
|
||||
import { classNames } from "../../../../utils";
|
||||
|
||||
type tabProps = {
|
||||
name:string;
|
||||
export default function TabComponent({ children, selected, id }) {
|
||||
const { removeFlow, flows } = useContext(TabsContext);
|
||||
return (
|
||||
<div
|
||||
className={classNames(
|
||||
selected ? " shadow-lg" : "bg-gray-300",
|
||||
"flex border-t border-l border-r border-black rounded-t-md shadow-sm cursor-pointer"
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
{flows.length > 1 && (
|
||||
<XMarkIcon
|
||||
className="w-5 hover:text-red-500"
|
||||
onClick={() => removeFlow(id)}
|
||||
></XMarkIcon>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export default function TabComponent({children,selected}){
|
||||
return(
|
||||
<div className={classNames(selected?" shadow-lg":"bg-gray-300","flex border-t border-l border-r border-black rounded-t-md shadow-sm cursor-pointer")}>
|
||||
{children}
|
||||
<XMarkIcon className="w-5 hover:text-red-500"></XMarkIcon>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue