import React, { Fragment } from "react"; import { connect } from "react-redux"; import { BooleanField, BulkDeleteWithConfirmButton, Datagrid, Filter, List, Pagination, ReferenceField, ReferenceManyField, SearchInput, SelectField, Show, Tab, TabbedShowLayout, TextField, useTranslate, } from "react-admin"; import get from "lodash/get"; import { Tooltip, Typography, Chip } from "@material-ui/core"; import HttpsIcon from "@material-ui/icons/Https"; import NoEncryptionIcon from "@material-ui/icons/NoEncryption"; import PageviewIcon from "@material-ui/icons/Pageview"; import UserIcon from "@material-ui/icons/Group"; import ViewListIcon from "@material-ui/icons/ViewList"; import VisibilityIcon from "@material-ui/icons/Visibility"; const RoomPagination = props => ( ); const EncryptionField = ({ source, record = {}, emptyText }) => { const translate = useTranslate(); const value = get(record, source); let ariaLabel = value === false ? "ra.boolean.false" : "ra.boolean.true"; if (value === false || value === true) { return ( {value === true ? ( ) : ( )} ); } return ( {emptyText} ); }; const RoomTitle = ({ record }) => { const translate = useTranslate(); var name = ""; if (record) { name = record.name !== "" ? record.name : record.id; } return ( {translate("resources.rooms.name", 1)} {name} ); }; export const RoomShow = props => { const translate = useTranslate(); return ( }> }> } path="detail" > }> "/users/" + id} > } path="permission" > ); }; const RoomBulkActionButtons = props => ( ); const RoomFilter = ({ ...props }) => { const translate = useTranslate(); return ( ); }; const FilterableRoomList = ({ ...props }) => { const filter = props.roomFilters; const localMembersFilter = filter && filter.joined_local_members ? true : false; const stateEventsFilter = filter && filter.state_events ? true : false; const versionFilter = filter && filter.version ? true : false; const federateableFilter = filter && filter.federatable ? true : false; const translate = useTranslate(); return ( } sort={{ field: "name", order: "ASC" }} filters={} bulkActionButtons={ } > } /> {localMembersFilter && } {stateEventsFilter && } {versionFilter && } {federateableFilter && } ); }; function mapStateToProps(state) { return { roomFilters: state.admin.resources.rooms.list.params.displayedFilters, }; } export const RoomList = connect(mapStateToProps)(FilterableRoomList);