import { createEffect, createSignal, For } from 'solid-js' import type { PopupProps } from '../_shared/Popup' import { Popup } from '../_shared/Popup' import { useLocalize } from '../../context/localize' export type MessageActionType = 'reply' | 'copy' | 'pin' | 'forward' | 'select' | 'delete' type MessageActionsPopup = { actionSelect?: (selectedAction) => void } & Omit export const MessageActionsPopup = (props: MessageActionsPopup) => { const [selectedAction, setSelectedAction] = createSignal(null) const { t } = useLocalize() const actions: { name: string; action: MessageActionType }[] = [ { name: t('Reply'), action: 'reply' }, { name: t('Copy'), action: 'copy' }, { name: t('Pin'), action: 'pin' }, { name: t('Forward'), action: 'forward' }, { name: t('Select'), action: 'select' }, { name: t('Delete'), action: 'delete' } ] createEffect(() => { if (props.actionSelect) props.actionSelect(selectedAction()) }) return (
    {(item) => (
  • setSelectedAction(item.action)} > {item.name}
  • )}
) }