Skip to content

Commit

Permalink
chore: fix github comment
Browse files Browse the repository at this point in the history
  • Loading branch information
reza-bm committed Nov 29, 2023
1 parent 3c36048 commit 7d1618b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
7 changes: 7 additions & 0 deletions components/common/IconStatus/IconStatus.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ export const BackgroundStatus = {
success: 'bg-backgroundSuccess',
unknown: 'bg-backgroundRunning',
};

export const TextColorStatus = {
running: 'text-running',
failed: 'text-failed',
success: 'text-success',
unknown: 'text-running',
};
11 changes: 7 additions & 4 deletions components/common/IconStatus/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import Image from 'next/image';
import { PropsType } from './IconStatus.type';
import { BackgroundStatus, SwapStatusIcon } from './IconStatus.helper';
import {
BackgroundStatus,
SwapStatusIcon,
TextColorStatus,
} from './IconStatus.helper';

function IconStatus(props: PropsType) {
const { status, hasTitle } = props;
const statusIcon = SwapStatusIcon[status];
const backgroundColor = BackgroundStatus[status];
const textColor = TextColorStatus[status];

return (
<>
Expand All @@ -15,9 +20,7 @@ function IconStatus(props: PropsType) {
} w-[24px] h-[24px] rounded-full flex items-center justify-center ${backgroundColor}`}>
<Image src={statusIcon} width={24} alt="status" />
</div>
{hasTitle && (
<div className={`text-16 text-${status.toLowerCase()}`}>{status}</div>
)}
{hasTitle && <div className={`text-16 ${textColor}`}>{status}</div>}
</>
);
}
Expand Down

0 comments on commit 7d1618b

Please sign in to comment.