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