-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
onehanddev
committed
Dec 10, 2024
1 parent
f2efe02
commit 332f3bf
Showing
12 changed files
with
202 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,31 @@ | ||
export type Score = "high" | "medium" | "low"; | ||
import { PROJECT_SCORE } from "@shared/entities/project-score.enum"; | ||
|
||
import { cn } from "@/lib/utils"; | ||
|
||
interface ScoreIndicatorProps { | ||
score: Score; | ||
className?: string; | ||
children?: React.ReactNode; | ||
bgColorClasses?: Record<PROJECT_SCORE, string>; | ||
} | ||
|
||
export const DEFAULT_BG_CLASSES = { | ||
high: "bg-high", | ||
medium: "bg-medium", | ||
low: "bg-low", | ||
}; | ||
|
||
export const ScoreIndicator = ({ | ||
score, | ||
children, | ||
className = "", | ||
}: ScoreIndicatorProps) => { | ||
const bgColorClass = { | ||
high: "bg-high", | ||
medium: "bg-medium", | ||
low: "bg-low", | ||
}[score]; | ||
|
||
return ( | ||
<div | ||
className={`flex h-10 items-center justify-center font-medium capitalize text-deep-ocean ${bgColorClass} ${className}`} | ||
className={cn( | ||
"flex h-10 items-center justify-center font-normal capitalize text-deep-ocean", | ||
className, | ||
)} | ||
> | ||
{children ? children : score} | ||
{children} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.