import { CloseOutlined } from "@ant-design/icons"; import { useAppDispatch, useAppSelector } from "@/store"; import { closeTab, setActiveTab } from "@/store/tabsSlice"; export default function TabStrip() { const tabs = useAppSelector((s) => s.tabs.tabs); const activeTabId = useAppSelector((s) => s.tabs.activeTabId); const dispatch = useAppDispatch(); return (
{tabs.map((t) => { const active = t.id === activeTabId; return (
dispatch(setActiveTab(t.id))} > {t.label} {t.closable !== false && ( { e.stopPropagation(); dispatch(closeTab(t.id)); }} > )}
); })}
); }