mirror of
https://github.com/owncast/owncast.git
synced 2024-11-25 22:31:09 +03:00
e50b23d081
* chore(js): be stricter about dead code warnings * chore(js): remove dead code and unused exports * rebase * chore: remove unused files * chore(deps): remove unused prop-types dep * chore(js): remove unused function * chore(deps): remove + check unused deps * chore(js): remove unused exports. Closes #3036
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import { Button, Typography } from 'antd';
|
|
import React, { useState, useContext, useEffect } from 'react';
|
|
import Link from 'next/link';
|
|
import { ServerStatusContext } from '../../../utils/server-status-context';
|
|
|
|
const { Title } = Typography;
|
|
|
|
export const FediverseNotify = () => {
|
|
const serverStatusData = useContext(ServerStatusContext);
|
|
const { serverConfig } = serverStatusData || {};
|
|
const { federation } = serverConfig || {};
|
|
|
|
const { enabled } = federation || {};
|
|
const [formDataValues, setFormDataValues] = useState<any>({});
|
|
|
|
useEffect(() => {
|
|
setFormDataValues({
|
|
enabled,
|
|
});
|
|
}, [enabled]);
|
|
|
|
return (
|
|
<>
|
|
<Title>Fediverse Social</Title>
|
|
<p className="description">
|
|
Enabling the Fediverse social features will not just alert people to when you go live, but
|
|
also enable other functionality.
|
|
</p>
|
|
<p>
|
|
Fediverse social features:{' '}
|
|
<span style={{ color: federation.enabled ? 'green' : 'red' }}>
|
|
{formDataValues.enabled ? 'Enabled' : 'Disabled'}
|
|
</span>
|
|
</p>
|
|
|
|
<Link passHref href="/admin/config-federation/">
|
|
<Button
|
|
type="primary"
|
|
style={{
|
|
position: 'relative',
|
|
marginLeft: 'auto',
|
|
right: '0',
|
|
marginTop: '20px',
|
|
}}
|
|
>
|
|
Configure
|
|
</Button>
|
|
</Link>
|
|
</>
|
|
);
|
|
};
|