Reorganize admin components to help bundling

This commit is contained in:
Gabe Kangas
2023-01-09 20:57:29 -08:00
parent 29882f1291
commit 7392ae8a54
67 changed files with 138 additions and 126 deletions

View 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;