chore(sqllab): Change icon color for running sql (#22050)

This commit is contained in:
JUST.in DO IT
2022-11-15 12:33:53 -08:00
committed by GitHub
parent 6f6cb1839e
commit 4f2e264b3f
4 changed files with 35 additions and 14 deletions

View File

@@ -17,12 +17,33 @@
* under the License.
*/
import React from 'react';
import { QueryState } from '@superset-ui/core';
import { QueryState, styled } from '@superset-ui/core';
import Icons, { IconType } from 'src/components/Icons';
const IconContainer = styled.span`
position: absolute;
top: -7px;
left: 0px;
`;
interface TabStatusIconProps {
tabState: QueryState;
}
const STATE_ICONS: Record<string, React.FC<IconType>> = {
success: Icons.Check,
failed: Icons.CancelX,
};
export default function TabStatusIcon({ tabState }: TabStatusIconProps) {
return <div className={`circle ${tabState}`} />;
const StatusIcon = STATE_ICONS[tabState];
return (
<div className={`circle ${tabState}`}>
{StatusIcon && (
<IconContainer>
<StatusIcon iconSize="xs" />
</IconContainer>
)}
</div>
);
}