Download src/components/shared/risk-alert.tsx from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 956 Bytes
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/src/components/shared/risk-alert.tsx
- Command line
-
hf download hf://SaylorTwift/openhands/src/components/shared/risk-alert.tsx
-
curl -L -o risk-alert.tsx https://huggingface.co/SaylorTwift/openhands/resolve/main/src/components/shared/risk-alert.tsx
956 Bytes
| import { ReactNode } from "react"; | |
| import { cn } from "#/utils/utils"; | |
| interface RiskAlertProps { | |
| className?: string; | |
| content: ReactNode; | |
| icon?: ReactNode; | |
| severity: "high" | "medium" | "low"; | |
| title: string; | |
| } | |
| export function RiskAlert({ | |
| className, | |
| content, | |
| icon, | |
| severity, | |
| title, | |
| }: RiskAlertProps) { | |
| // Currently, we are only supporting the high risk alert. If we use want to support other risk levels, we can add them here and use cva to create different variants of this component. | |
| if (severity === "high") { | |
| return ( | |
| <div | |
| className={cn( | |
| "flex items-center gap-3.5 bg-[#4A0709] border border-[#FF0006] text-red-400 rounded-xl px-3.5 h-13 text-sm text-white", | |
| className, | |
| )} | |
| > | |
| {icon && <span className="">{icon}</span>} | |
| <span className="font-bold">{title}</span> | |
| <span className="font-normal">{content}</span> | |
| </div> | |
| ); | |
| } | |
| return null; | |
| } | |