mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-02-08 18:39:31 +08:00
32 lines
698 B
TypeScript
32 lines
698 B
TypeScript
import { cn } from "@/lib/utils"
|
|
|
|
interface CalloutProps {
|
|
icon?: string
|
|
children?: React.ReactNode
|
|
type?: "default" | "warning" | "danger"
|
|
}
|
|
|
|
export function Callout({
|
|
children,
|
|
icon,
|
|
type = "default",
|
|
...props
|
|
}: CalloutProps) {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
"my-6 flex items-start rounded-md border border-b-4 border-slate-900 p-4",
|
|
{
|
|
"border-slate-900 dark:border-slate-700": type === "default",
|
|
"border-red-500": type === "danger",
|
|
"border-yellow-500": type === "warning",
|
|
}
|
|
)}
|
|
{...props}
|
|
>
|
|
{icon && <span className="mr-4 text-2xl">{icon}</span>}
|
|
<div>{children}</div>
|
|
</div>
|
|
)
|
|
}
|