mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-03 03:18:56 -04:00
37 lines
903 B
TypeScript
37 lines
903 B
TypeScript
import { ComponentType } from "react";
|
|
import { LucideProps } from "lucide-react";
|
|
import { cn } from "@/lib/cn";
|
|
|
|
export type SquareIconVariant = "default" | "info" | "warning" | "danger";
|
|
|
|
const variantClass: Record<SquareIconVariant, string> = {
|
|
default: "text-white",
|
|
info: "text-sky-400",
|
|
warning: "text-netbird",
|
|
danger: "text-red-500",
|
|
};
|
|
|
|
type SquareIconProps = {
|
|
icon: ComponentType<LucideProps>;
|
|
iconSize?: number;
|
|
variant?: SquareIconVariant;
|
|
className?: string;
|
|
};
|
|
|
|
export const SquareIcon = ({
|
|
icon: Icon,
|
|
iconSize = 18,
|
|
variant = "default",
|
|
className,
|
|
}: SquareIconProps) => (
|
|
<div
|
|
className={cn(
|
|
"h-11 w-11 rounded-lg flex items-center justify-center border bg-nb-gray-920 border-nb-gray-900",
|
|
variantClass[variant],
|
|
className,
|
|
)}
|
|
>
|
|
<Icon size={iconSize} />
|
|
</div>
|
|
);
|