cloud_bbb/ts/Manager/EditRoom.tsx

27 lines
798 B
TypeScript
Raw Permalink Normal View History

import React, { useState } from 'react';
import { Room, Restriction } from '../Common/Api';
import EditRoomDialog from './EditRoomDialog';
type Props = {
room: Room;
restriction?: Restriction;
2021-01-22 19:12:55 +01:00
updateProperty: (key: string, value: string | boolean | number | null) => Promise<void>;
}
const EditRoom: React.FC<Props> = ({ room, restriction, updateProperty }) => {
const [open, setOpen] = useState<boolean>(false);
return (
<>
<button onClick={ev => { ev.preventDefault(), setOpen(true); }}
title={t('bbb', 'Edit')} className="action-item">
<span className="icon icon-settings-dark icon-visible"></span>
</button>
<EditRoomDialog room={room} restriction={restriction} updateProperty={updateProperty} open={open} setOpen={setOpen} />
</>
);
};
export default EditRoom;