0
owncast/web/components/admin/FormStatusIndicator.tsx
mahmed2000 d9a0d13479
Communicate and handle apub outgoing updates being delayed (#4009)
* Allow icon only status messages such as STATUS_PROCESSING to be displayed

* Add a processing status state for the EditSocialLinks component

* Log warning for the outbound apub channel being full

* Buffer the outbound apub channel so some API requests are less likely to get blocked during handling

* Make the apub outbound request trace-log always occur after being queued.

* Linting fix
2024-11-30 14:38:00 -08:00

25 lines
697 B
TypeScript

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