import React, { useState, useEffect } from "react"; import { Table, Tag, Space, Button, Modal, Checkbox, Input, Typography } from 'antd'; import { DeleteOutlined, EyeTwoTone, EyeInvisibleOutlined } from '@ant-design/icons'; const { Title, Paragraph, Text } = Typography; import format from 'date-fns/format' import { fetchData, ACCESS_TOKENS, DELETE_ACCESS_TOKEN, CREATE_ACCESS_TOKEN, } from "../utils/apis"; const scopeMapping = { 'CAN_SEND_SYSTEM_MESSAGES': 'system chat', 'CAN_SEND_MESSAGES': 'user chat', }; function convertScopeStringToRenderString(scope) { if (!scope || !scopeMapping[scope]) { return "unknown"; } return scopeMapping[scope].toUpperCase(); } function NewTokenModal(props) { var selectedScopes = []; const scopes = [ { value: 'CAN_SEND_SYSTEM_MESSAGES', label: 'Can send system chat messages', description: 'Can send chat messages as the offical system user.' }, { value: 'CAN_SEND_MESSAGES', label: 'Can send user chat messages', description: 'Can send chat messages as any user name.' }, ] function onChange(checkedValues) { selectedScopes = checkedValues } function saveToken() { props.onOk(name, selectedScopes) } const [name, setName] = useState(''); return (

setName(input.currentTarget.value)} />

Select the permissions this access token will have. It cannot be edited after it's created.

) } export default function AccessTokens() { const [tokens, setTokens] = useState([]); const [isTokenModalVisible, setIsTokenModalVisible] = useState(false); const columns = [ { title: '', key: 'delete', render: (text, record) => (