/** * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ import styles from "./ingress-class-details.module.scss"; import React from "react"; import { observer } from "mobx-react"; import { DrawerItem, DrawerTitle } from "../drawer"; import type { IngressClass } from "../../../common/k8s-api/endpoints"; import type { KubeObjectDetailsProps } from "../kube-object-details"; import { withInjectables } from "@ogre-tools/injectable-react"; export interface IngressClassDetailsProps extends KubeObjectDetailsProps { } @observer class NonInjectedIngressDetails extends React.Component { renderParameters() { const { object: ingressClass } = this.props; if (!ingressClass.spec.parameters) return; return ( <> Parameters {ingressClass.getCtrlName()} {ingressClass.getCtrlNs()} {ingressClass.getCtrlScope()} {ingressClass.getCtrlKind()} {ingressClass.getCtrlApiGroup()} ); } render() { const { object: ingressClass } = this.props; return (
{ingressClass.getController()} {this.renderParameters()}
); } } export const IngressClassDetails = withInjectables<{}, IngressClassDetailsProps>(NonInjectedIngressDetails, { getProps: (di, props) => (props), });