Use TRee component for Environment dialog (#288)

This commit is contained in:
Gregory Schier
2025-10-31 09:16:29 -07:00
committed by GitHub
parent c9698c0f23
commit e3e67c8df7
25 changed files with 502 additions and 342 deletions

View File

@@ -4,22 +4,25 @@ import type { CSSProperties } from 'react';
interface Props {
color: string | null;
onClick?: () => void;
className?: string;
}
export function ColorIndicator({ color, onClick }: Props) {
export function ColorIndicator({ color, onClick, className }: Props) {
const style: CSSProperties = { backgroundColor: color ?? undefined };
const className =
'inline-block w-[0.75em] h-[0.75em] rounded-full mr-1.5 border border-transparent';
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
onClick={onClick}
style={style}
className={classNames(className, 'hover:border-text')}
className={classNames(finalClassName, 'hover:border-text')}
/>
);
} else {
return <span style={style} className={className} />;
return <span style={style} className={finalClassName} />;
}
}