OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.
import type { HtmlProps } from '@/types';
import { cn } from '@/utils/cn';
type ColorSquareProps = HtmlProps<HTMLDivElement>;
export function ColorSquare({ children, className, color }: ColorSquareProps) {
return (
<div
className={cn(
'flex h-5 w-5 flex-shrink-0 items-center justify-center rounded bg-blue-600 font-medium text-sm text-white tabular-nums [.mini_&]:h-4 [.mini_&]:w-4 [.mini_&]:text-[0.6rem]',
className
)}
style={{ backgroundColor: color }}
>
{children}
</div>
);
}