mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-25 10:51:57 +01:00
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
740 B
TypeScript
29 lines
740 B
TypeScript
import classNames from "classnames";
|
|
import type { CSSProperties } from "react";
|
|
|
|
interface Props {
|
|
color: string | null;
|
|
onClick?: () => void;
|
|
className?: string;
|
|
}
|
|
|
|
export function ColorIndicator({ color, onClick, className }: Props) {
|
|
const style: CSSProperties = { backgroundColor: color ?? undefined };
|
|
const finalClassName = classNames(
|
|
className,
|
|
"inline-block w-[0.75em] h-[0.75em] rounded-full mr-1.5 border border-transparent flex-shrink-0",
|
|
);
|
|
|
|
if (onClick) {
|
|
return (
|
|
<button
|
|
type="button"
|
|
onClick={onClick}
|
|
style={style}
|
|
className={classNames(finalClassName, "hover:border-text")}
|
|
/>
|
|
);
|
|
}
|
|
return <span style={style} className={finalClassName} />;
|
|
}
|