feat: Add option to replace existing file attachment in editor
This commit is contained in:
34
app/editor/menus/attachment.tsx
Normal file
34
app/editor/menus/attachment.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { TrashIcon, DownloadIcon, ReplaceIcon } from "outline-icons";
|
||||
import { EditorState } from "prosemirror-state";
|
||||
import * as React from "react";
|
||||
import { MenuItem } from "@shared/editor/types";
|
||||
import { Dictionary } from "~/hooks/useDictionary";
|
||||
|
||||
export default function attachmentMenuItems(
|
||||
state: EditorState,
|
||||
dictionary: Dictionary
|
||||
): MenuItem[] {
|
||||
return [
|
||||
{
|
||||
name: "replaceAttachment",
|
||||
tooltip: dictionary.replaceAttachment,
|
||||
icon: <ReplaceIcon />,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
name: "deleteAttachment",
|
||||
tooltip: dictionary.deleteAttachment,
|
||||
icon: <TrashIcon />,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
name: "separator",
|
||||
},
|
||||
{
|
||||
name: "downloadAttachment",
|
||||
label: dictionary.download,
|
||||
icon: <DownloadIcon />,
|
||||
visible: !!fetch,
|
||||
},
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user