import {useState} from 'react'; import {ColorPicker} from './color-picker'; import {DialogFooter} from '../overlays/dialog/dialog-footer'; import {Button} from '../buttons/button'; import {useDialogContext} from '../overlays/dialog/dialog-context'; import {Dialog} from '../overlays/dialog/dialog'; import {Trans} from '../../i18n/trans'; interface ColorPickerDialogProps { defaultValue?: string; onChange?: (color: string) => void; hideFooter?: boolean; showInput?: boolean; } export function ColorPickerDialog({ defaultValue, onChange, hideFooter = false, showInput = true, }: ColorPickerDialogProps) { const {close} = useDialogContext(); const [value, setValue] = useState(defaultValue || ''); // todo: remove this once pixie and bedrive are refactored to use dialogTrigger currentValue (use "currentValue" for defaultValue as well) //const initialValue = useRef(defaultValue); return ( { setValue(newValue); onChange?.(newValue); }} /> {!hideFooter && ( )} ); }