start file rename logic

This commit is contained in:
Ishaan Dey
2024-04-27 11:08:19 -04:00
parent 1b6bd01989
commit 76b2fc7e0f
6 changed files with 73 additions and 16 deletions

View File

@ -6,11 +6,13 @@ import { useEffect } from "react"
export default function Tab({
children,
selected,
saved = true,
selected = false,
onClick,
onClose,
}: {
children: React.ReactNode
saved?: boolean
selected?: boolean
onClick?: () => void
onClose?: () => void
@ -20,7 +22,7 @@ export default function Tab({
onClick={onClick ?? undefined}
size="sm"
variant={"secondary"}
className={`group font-normal select-none ${
className={`font-normal select-none ${
selected
? "bg-neutral-700 hover:bg-neutral-600 text-foreground"
: "text-muted-foreground"
@ -37,9 +39,16 @@ export default function Tab({
}
: undefined
}
className="h-5 w-5 ml-0.5 flex items-center justify-center translate-x-1 transition-colors bg-transparent hover:bg-muted-foreground/25 cursor-pointer rounded-sm"
className="h-5 w-5 ml-0.5 group flex items-center justify-center translate-x-1 transition-colors bg-transparent hover:bg-muted-foreground/25 cursor-pointer rounded-sm"
>
<X className="w-3 h-3" />
{saved ? (
<X className="w-3 h-3" />
) : (
<>
<X className="w-3 h-3 group-hover:block hidden" />
<div className="w-2 h-2 rounded-full bg-foreground group-hover:hidden" />
</>
)}
</div>
</Button>
)