/* eslint-disable */ // @ts-nocheck import { Action, KeycloakDataTable, ListEmptyState, } from "../../../shared/keycloak-ui-shared"; import { Button, ToolbarItem } from "../../../shared/@patternfly/react-core"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { translationFormatter } from "../../utils/translationFormatter"; export type EventType = { id: string; }; type EventsTypeTableProps = { ariaLabelKey?: string; eventTypes: string[]; addTypes?: () => void; onSelect?: (value: EventType[]) => void; onDelete?: (value: EventType) => void; onDeleteAll?: (value: EventType[]) => void; }; export function EventsTypeTable({ ariaLabelKey = "userEventsRegistered", eventTypes, addTypes, onSelect, onDelete, onDeleteAll, }: EventsTypeTableProps) { const { t } = useTranslation(); const [selectedTypes, setSelectedTypes] = useState([]); const data = eventTypes.map((type) => ({ id: type, name: t(`eventTypes.${type}.name`), description: t(`eventTypes.${type}.description`), })); return ( {addTypes && ( )} {onDeleteAll && ( )} } actions={ !onDelete ? [] : [ { title: t("remove"), onRowClick: onDelete, } as Action, ] } columns={[ { name: "name", displayKey: "eventType", }, { name: "description", cellFormatters: [translationFormatter(t)], }, ]} emptyState={ } /> ); }