Skip to content

Commit

Permalink
reduced Spin size and removed inline styles
Browse files Browse the repository at this point in the history
  • Loading branch information
bekossy committed May 3, 2024
1 parent 34b6c16 commit b9b5ed7
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions agenta-web/src/components/ResultComponent/ResultComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {JSSTheme} from "@/lib/Types"
import {CloseCircleFilled} from "@ant-design/icons"
import {Result, Spin, Typography} from "antd"
import React, {ReactNode} from "react"
import {createUseStyles} from "react-jss"
const {Title} = Typography

interface ResultComponentProps {
Expand All @@ -10,17 +12,28 @@ interface ResultComponentProps {
spinner?: boolean
}

const useStyles = createUseStyles((theme: JSSTheme) => ({
closeCircleIcon: {
color: "#ff4d4f",
},
title: {
textTransform: "capitalize",
},
}))

const ResultComponent: React.FC<ResultComponentProps> = ({status, title, subtitle, spinner}) => {
const classes = useStyles()

return (
<Result
icon={status === "error" && <CloseCircleFilled style={{color: "#ff4d4f"}} />}
icon={status === "error" && <CloseCircleFilled className={classes.closeCircleIcon} />}
title={
<Title level={3} style={{textTransform: "capitalize"}}>
<Title level={3} className={classes.title}>
{title}
</Title>
}
subTitle={subtitle}
extra={spinner && <Spin size="large" />}
extra={spinner && <Spin />}
/>
)
}
Expand Down

0 comments on commit b9b5ed7

Please sign in to comment.