mirror of
https://github.com/apache/superset.git
synced 2026-04-27 20:14:54 +00:00
refactor: icon to icons for basicerror componenet (#15336)
* initial commit * initial commit * fix test * lint fix * Update superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com> * lint Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
680b447bc4
commit
a477505291
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
import React from 'react';
|
||||
import { styled, supersetTheme } from '@superset-ui/core';
|
||||
import Icon from '../Icon';
|
||||
import Icons from 'src/components/Icons';
|
||||
import { ErrorLevel } from './types';
|
||||
|
||||
const StyledContainer = styled.div<{ level: ErrorLevel }>`
|
||||
@@ -56,10 +56,11 @@ export default function BasicErrorAlert({
|
||||
}: BasicErrorAlertProps) {
|
||||
return (
|
||||
<StyledContainer level={level} role="alert">
|
||||
<Icon
|
||||
name={level === 'error' ? 'error-solid' : 'warning-solid'}
|
||||
color={supersetTheme.colors[level].base}
|
||||
/>
|
||||
{level === 'error' ? (
|
||||
<Icons.ErrorSolid iconColor={supersetTheme.colors[level].base} />
|
||||
) : (
|
||||
<Icons.WarningSolid iconColor={supersetTheme.colors[level].base} />
|
||||
)}
|
||||
<StyledContent>
|
||||
<StyledTitle>{title}</StyledTitle>
|
||||
<p>{body}</p>
|
||||
|
||||
Reference in New Issue
Block a user