mirror of
https://github.com/RoboSats/robosats.git
synced 2025-02-23 21:59:02 +00:00
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import React, { useState } from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { Paper, Alert, AlertTitle, Button, Link } from '@mui/material';
|
|
|
|
const SelfhostedAlert = (): JSX.Element => {
|
|
const { t } = useTranslation();
|
|
const [show, setShow] = useState<boolean>(true);
|
|
|
|
// If alert is hidden return null
|
|
if (!show) {
|
|
return <></>;
|
|
}
|
|
// Show selfhosted notice
|
|
else {
|
|
return (
|
|
<div>
|
|
<Paper elevation={6} className='unsafeAlert'>
|
|
<Alert
|
|
severity='success'
|
|
sx={{ maxHeight: '8em' }}
|
|
action={
|
|
<Button
|
|
color='success'
|
|
onClick={() => {
|
|
setShow(false);
|
|
}}
|
|
>
|
|
{t('Hide')}
|
|
</Button>
|
|
}
|
|
>
|
|
<AlertTitle>{t('You are self-hosting RoboSats')}</AlertTitle>
|
|
{t(
|
|
'RoboSats client is served from your own node granting you the strongest security and privacy.',
|
|
)}
|
|
</Alert>
|
|
</Paper>
|
|
</div>
|
|
);
|
|
}
|
|
};
|
|
|
|
export default SelfhostedAlert;
|