robosats/frontend/src/components/HostAlert/SelfhostedAlert.tsx
Reckless_Satoshi 052865c53b
Add selfhosted client custom builds (#630)
Add scripts for selfhosted client
2023-05-29 15:58:12 +00:00

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;