mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-27 06:34:12 +00:00
36 lines
764 B
TypeScript
36 lines
764 B
TypeScript
import { cn } from "@/lib/utils"
|
|
import {
|
|
Alert,
|
|
AlertDescription,
|
|
AlertTitle,
|
|
} from "@/registry/new-york-v4/ui/alert"
|
|
|
|
export function Callout({
|
|
title,
|
|
children,
|
|
icon,
|
|
className,
|
|
variant = "default",
|
|
...props
|
|
}: React.ComponentProps<typeof Alert> & {
|
|
icon?: React.ReactNode
|
|
variant?: "default" | "info" | "warning"
|
|
}) {
|
|
return (
|
|
<Alert
|
|
data-variant={variant}
|
|
className={cn(
|
|
"mt-6 w-auto rounded-xl border-surface bg-surface text-surface-foreground md:-mx-1 **:[code]:border",
|
|
className
|
|
)}
|
|
{...props}
|
|
>
|
|
{icon}
|
|
{title && <AlertTitle>{title}</AlertTitle>}
|
|
<AlertDescription className="text-card-foreground/80">
|
|
{children}
|
|
</AlertDescription>
|
|
</Alert>
|
|
)
|
|
}
|