mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-15 00:03:26 +01:00
24 lines
589 B
TypeScript
24 lines
589 B
TypeScript
import type { Environment } from '@yaakapp-internal/models';
|
|
import { showColorPicker } from '../lib/showColorPicker';
|
|
import { ColorIndicator } from './ColorIndicator';
|
|
|
|
export function EnvironmentColorIndicator({
|
|
environment,
|
|
clickToEdit,
|
|
className,
|
|
}: {
|
|
environment: Environment | null;
|
|
clickToEdit?: boolean;
|
|
className?: string;
|
|
}) {
|
|
if (environment?.color == null) return null;
|
|
|
|
return (
|
|
<ColorIndicator
|
|
className={className}
|
|
color={environment?.color ?? null}
|
|
onClick={clickToEdit ? () => showColorPicker(environment) : undefined}
|
|
/>
|
|
);
|
|
}
|