import React from "react"; import { IOsQueryTable } from "interfaces/osquery_table"; import { osqueryTableNames } from "utilities/osquery_tables"; // @ts-ignore import Dropdown from "components/forms/fields/Dropdown"; import FleetMarkdown from "components/FleetMarkdown"; import CustomLink from "components/CustomLink"; import Icon from "components/Icon/Icon"; import QueryTableColumns from "./QueryTableColumns"; import QueryTablePlatforms from "./QueryTablePlatforms"; import QueryTableExample from "./QueryTableExample"; import QueryTableNotes from "./QueryTableNotes"; import EventedTableTag from "./EventedTableTag"; interface IQuerySidePanel { selectedOsqueryTable: IOsQueryTable; onOsqueryTableSelect: (tableName: string) => void; onClose: () => void; } const baseClass = "query-side-panel"; const QuerySidePanel = ({ selectedOsqueryTable, onOsqueryTableSelect, onClose, }: IQuerySidePanel): JSX.Element => { const { name, description, platforms, columns, examples, notes, evented, } = selectedOsqueryTable; const mdmRequired = name === "managed_policies"; const onSelectTable = (value: string) => { onOsqueryTableSelect(value); }; const renderTableSelect = () => { const tableNames = osqueryTableNames.map((tableName: string) => { return { label: tableName, value: tableName }; }); return ( ); }; return ( <>
{ if (e.key === "Enter" || e.key === " ") { onClose(); } }} >

Tables {osqueryTableNames.length}

{renderTableSelect()}
{evented && } {mdmRequired && ( Requires MDM )}
{examples && } {notes && } ); }; export default QuerySidePanel;