import { UxCommand } from "../constants"; import { Command } from "../types"; import { setPluginState } from "./AttachmentPlugin"; const pickAttachmentFile: Command = (state, dispatch) => { if (dispatch !== undefined) { setPluginState({ state, dispatch }, prevState => ({ ...prevState, presentFilePicker: { accept: "" } })); } return true; }; const pickAttachmentImage: Command = (state, dispatch) => { if (dispatch !== undefined) { setPluginState({ state, dispatch }, prevState => ({ ...prevState, presentFilePicker: { accept: "image/*" } })); } return true; }; export const ux = { [UxCommand.PickAttachmentFile]: pickAttachmentFile, [UxCommand.PickAttachmentImage]: pickAttachmentImage };