// Copyright 2024, Command Line Inc. // SPDX-License-Identifier: Apache-2.0 import { Button } from "@/element/button"; import * as WOS from "@/store/wos"; import { clsx } from "clsx"; import React from "react"; import "./tab.less"; interface TabProps { id: string; active: boolean; isBeforeActive: boolean; isDragging: boolean; onSelect: () => void; onClose: () => void; onDragStart: () => void; } const Tab = React.forwardRef( ({ id, active, isBeforeActive, isDragging, onSelect, onClose, onDragStart }, ref) => { const [tabData, tabLoading] = WOS.useWaveObjectValue(WOS.makeORef("tab", id)); const name = tabData?.name ?? "..."; return (
{name}
{!isDragging &&
} {active &&
}
); } ); export { Tab };