1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/packages/table/index.ts
Alex Andreev 54366c3739 Fixing import address
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
2023-05-25 11:22:02 +03:00

38 lines
994 B
TypeScript

import { getInjectionToken } from "@ogre-tools/injectable";
import type { KubeObject } from "@k8slens/kube-object/src/kube-object";
import type {
BaseKubeObjectListLayoutColumn,
GeneralKubeObjectListLayoutColumn,
SpecificKubeListLayoutColumn,
} from "@k8slens/list-layout";
import React from "react";
type Column = (
| BaseKubeObjectListLayoutColumn<KubeObject>
| SpecificKubeListLayoutColumn<KubeObject>
| GeneralKubeObjectListLayoutColumn
);
export interface TableComponentProps {
tableId?: string;
columns?: Column[];
save?: (state: object) => void;
load?: (tableId: string) => object;
}
export interface TableDataContextValue {
columns?: Column[];
}
export const TableDataContext = React.createContext<TableDataContextValue>({
columns: [],
});
export interface TableComponent {
Component: React.ComponentType<TableComponentProps>;
}
export const tableComponentInjectionToken = getInjectionToken<TableComponent>({
id: "table-component-injection-token",
});