mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-25 03:34:22 +01:00
23 lines
569 B
TypeScript
23 lines
569 B
TypeScript
import { type ComponentProps, splitProps } from "solid-js"
|
|
|
|
export interface CardProps extends ComponentProps<"div"> {
|
|
variant?: "normal" | "error" | "warning" | "success" | "info"
|
|
}
|
|
|
|
export function Card(props: CardProps) {
|
|
const [split, rest] = splitProps(props, ["variant", "class", "classList"])
|
|
return (
|
|
<div
|
|
{...rest}
|
|
data-component="card"
|
|
data-variant={split.variant || "normal"}
|
|
classList={{
|
|
...(split.classList ?? {}),
|
|
[split.class ?? ""]: !!split.class,
|
|
}}
|
|
>
|
|
{props.children}
|
|
</div>
|
|
)
|
|
}
|