mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-24 09:18:27 +00:00
13 lines
498 B
TypeScript
13 lines
498 B
TypeScript
// Copyright 2025, Command Line Inc.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import { WOS } from "@/app/store/global";
|
|
import { Atom, Getter } from "jotai";
|
|
|
|
export function getLayoutStateAtomFromTab(tabAtom: Atom<Tab>, get: Getter): Atom<LayoutState> {
|
|
const tabData = get(tabAtom);
|
|
if (!tabData) return;
|
|
const layoutStateOref = WOS.makeORef("layout", tabData.layoutstate);
|
|
const layoutStateAtom = WOS.getWaveObjectAtom<LayoutState>(layoutStateOref);
|
|
return layoutStateAtom;
|
|
}
|