// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import React from 'react'; import { CustomStyleRulesCallback } from 'common/custom-theme'; import { IconButton, Paper, List, Checkbox, ListItemText, ListItem, Tooltip } from '@mui/material'; import { WithStyles } from '@mui/styles'; import withStyles from '@mui/styles/withStyles'; import MenuIcon from "@mui/icons-material/Menu"; import { DataColumn, DataColumns } from '../data-table/data-column'; import { Popover } from "../popover/popover"; import { IconButtonProps } from '@mui/material/IconButton'; import { ArvadosTheme } from "common/custom-theme"; interface ColumnSelectorDataProps { columns: DataColumns; onColumnToggle: (column: DataColumn) => void; className?: string; } type CssRules = "checkbox" | "listItem" | "listItemText"; const styles: CustomStyleRulesCallback = (theme: ArvadosTheme) => ({ checkbox: { width: 24, height: 24 }, listItem: { padding: 0, }, listItemText: { paddingLeft: '4px', } }); export type ColumnSelectorProps = ColumnSelectorDataProps & WithStyles; export const ColumnSelector = withStyles(styles)( ({ columns, onColumnToggle, classes }: ColumnSelectorProps) => {columns .filter(column => column.configurable) .map((column, index) => onColumnToggle(column)}> {column.name} )} ); export const ColumnSelectorTrigger = (props: IconButtonProps) => ;