fix(plugin-workflow): fix client warning (#4709)

* fix(plugin-workflow): fix client warning

* fix(plugin-workflow): fix build error
This commit is contained in:
Junyi 2024-06-20 10:59:36 +08:00 committed by GitHub
parent a9f1ce7bd6
commit 8a629d06ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,16 +31,17 @@ const useStyles = createStyles(({ css, token }) => ({
}));
export function StatusButton(props) {
const { status, statusMap, ...others } = props;
const { styles } = useStyles();
let tag = null;
if (typeof props.status !== 'undefined' && props.statusMap?.[props.status]) {
const { icon, color } = props.statusMap[props.status];
if (typeof status !== 'undefined' && statusMap?.[status]) {
const { icon, color } = statusMap[status];
tag = <Tag color={color}>{icon}</Tag>;
}
return (
<Button
{...props}
{...others}
shape="circle"
size="small"
className={classnames(tag ? styles.statusButtonClass : styles.noStatusButtonClass, props.className)}