owncast/web/components/config/form-status-indicator.tsx

23 lines
638 B
TypeScript
Raw Normal View History

import React from 'react';
import classNames from 'classnames';
import { StatusState } from '../../utils/input-statuses';
interface FormStatusIndicatorProps {
status: StatusState;
}
export default function FormStatusIndicator({ status }: FormStatusIndicatorProps) {
const { type, icon, message } = status || {};
const classes = classNames({
'status-container': true,
[`status-${type}`]: type,
empty: !message,
});
return (
2021-02-21 00:14:50 +01:00
<span className={classes}>
{icon ? <span className="status-icon">{icon}</span> : null}
{message ? <span className="status-message">{message}</span> : null}
2021-02-21 00:14:50 +01:00
</span>
);
}