(
waveEnv: TabBackgroundEnv,
tabId: string | null
)
| 173 | } |
| 174 | |
| 175 | export function useTabBackground( |
| 176 | waveEnv: TabBackgroundEnv, |
| 177 | tabId: string | null |
| 178 | ): [string, string, BackgroundConfigType] { |
| 179 | const tabActiveBorderColorDirect = jotai.useAtomValue(waveEnv.getTabMetaKeyAtom(tabId, "bg:activebordercolor")); |
| 180 | const tabBorderColorDirect = jotai.useAtomValue(waveEnv.getTabMetaKeyAtom(tabId, "bg:bordercolor")); |
| 181 | const tabBg = jotai.useAtomValue(waveEnv.getTabMetaKeyAtom(tabId, "tab:background")); |
| 182 | const configBg = jotai.useAtomValue(waveEnv.getConfigBackgroundAtom(tabBg)); |
| 183 | const tabActiveBorderColor = tabActiveBorderColorDirect ?? configBg?.["bg:activebordercolor"]; |
| 184 | const tabBorderColor = tabBorderColorDirect ?? configBg?.["bg:bordercolor"]; |
| 185 | return [tabBorderColor, tabActiveBorderColor, configBg]; |
| 186 | } |
| 187 | |
| 188 | export const Input = React.memo( |
| 189 | ({ decl, className, preview }: { decl: HeaderInput; className: string; preview: boolean }) => { |
no outgoing calls
no test coverage detected