add resizing logic

This commit is contained in:
Ishaan Dey
2024-05-09 22:16:56 -07:00
parent 1500e84724
commit e86e86dbe2
8 changed files with 150 additions and 50 deletions

View File

@ -6,6 +6,7 @@ import { MouseEvent, MouseEventHandler, useEffect } from "react";
export default function Tab({
children,
creating = false,
saved = true,
selected = false,
onClick,
@ -13,6 +14,7 @@ export default function Tab({
closing = false,
}: {
children: React.ReactNode;
creating?: boolean;
saved?: boolean;
selected?: boolean;
onClick?: MouseEventHandler<HTMLButtonElement>;
@ -43,7 +45,7 @@ export default function Tab({
}
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"
>
{closing ? (
{closing || creating ? (
<Loader2 className="animate-spin w-3 h-3" />
) : saved ? (
<X className="w-3 h-3" />