import * as React from "react"; import {ContextualActions} from "./contextual-actions"; import * as styles from "./style/line.css"; export type LineStyle = Partial; export interface OperationListItem { action: (data?: {}) => void; buttonShape?: "raised" | "fab" | "icon" | "mini-fab"; label?: string; icon?: string; iconLibrary?: "material" | "font-awesome" | "font-custom"; priority?: number; style?: string | React.CSSProperties; } export interface LineProps { classNames?: LineStyle; data?: T; onLineClick?: (data: T) => void; operationList?: OperationListItem[]; } /** * Retourne les actions contextuelles pour une ligne quelconque. * @param {data, operationList} Les données et la liste d'actions de la ligne. * @param isSelection Utilise les classes CSS de la ligne de sélection. */ export function renderLineActions({classNames, data, operationList}: LineProps, isSelection = false) { if (operationList && operationList.length > 0) { return (
); } else { return null; } }