mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
32 lines
906 B
TypeScript
32 lines
906 B
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
|
|
import React from "react";
|
|
import { observer } from "mobx-react";
|
|
import { TabLayout, TabLayoutRoute } from "../layout/tab-layout";
|
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
|
import type { IComputedValue } from "mobx";
|
|
import helmRoutesInjectable from "./route-tabs.injectable";
|
|
|
|
export interface HelmRouteProps {}
|
|
|
|
interface Dependencies {
|
|
routes: IComputedValue<TabLayoutRoute[]>;
|
|
}
|
|
|
|
const NonInjectedHelmRoute = observer(({ routes }: Dependencies & HelmRouteProps) => (
|
|
<TabLayout
|
|
className="Apps"
|
|
tabs={routes.get()}
|
|
/>
|
|
));
|
|
|
|
export const HelmRoute = withInjectables<Dependencies, HelmRouteProps>(NonInjectedHelmRoute, {
|
|
getProps: (di, props) => ({
|
|
routes: di.inject(helmRoutesInjectable),
|
|
...props,
|
|
}),
|
|
});
|