Files
Ghom 291dcf9515 Merge pull request #10575 from Arturlang/TGUIs_Nexties
[TESTMERGE] Properly working TGUI Next
2021-01-04 19:47:54 -03:00

43 lines
1014 B
JavaScript

import { Button, Flex, NoticeBox } from '../../components';
export const InterfaceLockNoticeBox = props => {
const {
siliconUser,
locked,
onLockStatusChange,
accessText,
} = props;
// For silicon users
if (siliconUser) {
return (
<NoticeBox>
<Flex align="center">
<Flex.Item>
Interface lock status:
</Flex.Item>
<Flex.Item grow={1} />
<Flex.Item>
<Button
m={0}
color="gray"
icon={locked ? 'lock' : 'unlock'}
content={locked ? 'Locked' : 'Unlocked'}
onClick={() => {
if (onLockStatusChange) {
onLockStatusChange(!locked);
}
}} />
</Flex.Item>
</Flex>
</NoticeBox>
);
}
// For everyone else
return (
<NoticeBox>
Swipe {accessText || 'an ID card'}{' '}
to {locked ? 'unlock' : 'lock'} this interface.
</NoticeBox>
);
};