import { SharedStyle, StyleProp, preventDefault } from '@bigbluebutton/editor' import { Trigger } from '@radix-ui/react-dropdown-menu' import * as React from 'react' import { TLUiTranslationKey } from '../../hooks/useTranslation/TLUiTranslationKey' import { useTranslation } from '../../hooks/useTranslation/useTranslation' import { TLUiIconType } from '../../icon-types' import { Button, TLUiButtonProps } from '../primitives/Button' import * as DropdownMenu from '../primitives/DropdownMenu' import { StyleValuesForUi } from './styles' interface DropdownPickerProps { id: string label?: TLUiTranslationKey | Exclude uiType: string style: StyleProp value: SharedStyle items: StyleValuesForUi type: TLUiButtonProps['type'] onValueChange: (style: StyleProp, value: T, squashing: boolean) => void } export const DropdownPicker = React.memo(function DropdownPicker({ id, label, uiType, style, items, type, value, onValueChange, }: DropdownPickerProps) { const msg = useTranslation() const icon = React.useMemo( () => items.find((item) => value.type === 'shared' && item.value === value.value)?.icon, [items, value] ) return ( preventDefault(e)} >