mirror of
https://github.com/owncast/owncast.git
synced 2024-11-23 21:28:29 +03:00
22 lines
638 B
TypeScript
22 lines
638 B
TypeScript
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 (
|
|
<span className={classes}>
|
|
{icon ? <span className="status-icon">{icon}</span> : null}
|
|
{message ? <span className="status-message">{message}</span> : null}
|
|
</span>
|
|
);
|
|
}
|