blob: 35e605af73c0855d9f6d9ea4ab14ad14a277ff50 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
import { ComponentPropsWithoutRef, Ref } from "react";
import classNames from "classnames";
import { ThemeColor } from "./common";
import "./Card.css";
interface CardProps extends ComponentPropsWithoutRef<"div"> {
containerRef?: Ref<HTMLDivElement>;
color?: ThemeColor;
}
export default function Card({
color,
className,
children,
containerRef,
...otherProps
}: CardProps) {
color = color ?? "primary";
return (
<div
ref={containerRef}
className={classNames("cru-card", `cru-${color}`, className)}
{...otherProps}
>
{children}
</div>
);
}
|