mirror of
https://github.com/portainer/portainer.git
synced 2025-07-31 03:09:44 +02:00
fix(edge): only show expand row for Edge Devices with AMT activated [EE-2489] (#6519)
This commit is contained in:
parent
37ca62eb06
commit
2bffba7371
5 changed files with 46 additions and 16 deletions
|
@ -2,21 +2,24 @@ import { createContext, useContext, useMemo, PropsWithChildren } from 'react';
|
|||
|
||||
interface RowContextState {
|
||||
disableTrustOnFirstConnect: boolean;
|
||||
isOpenAmtEnabled: boolean;
|
||||
}
|
||||
|
||||
const RowContext = createContext<RowContextState | null>(null);
|
||||
|
||||
export interface RowProviderProps {
|
||||
disableTrustOnFirstConnect: boolean;
|
||||
isOpenAmtEnabled: boolean;
|
||||
}
|
||||
|
||||
export function RowProvider({
|
||||
disableTrustOnFirstConnect,
|
||||
isOpenAmtEnabled,
|
||||
children,
|
||||
}: PropsWithChildren<RowProviderProps>) {
|
||||
const state = useMemo(
|
||||
() => ({ disableTrustOnFirstConnect }),
|
||||
[disableTrustOnFirstConnect]
|
||||
() => ({ disableTrustOnFirstConnect, isOpenAmtEnabled }),
|
||||
[disableTrustOnFirstConnect, isOpenAmtEnabled]
|
||||
);
|
||||
|
||||
return <RowContext.Provider value={state}>{children}</RowContext.Provider>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue