Reorganize admin components to help bundling
This commit is contained in:
24
web/components/admin/FormStatusIndicator.tsx
Normal file
24
web/components/admin/FormStatusIndicator.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
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,
|
||||
});
|
||||
return (
|
||||
<span className={classes}>
|
||||
{icon ? <span className="status-icon">{icon}</span> : null}
|
||||
{message ? <span className="status-message">{message}</span> : null}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
export default FormStatusIndicator;
|
||||
Reference in New Issue
Block a user