move file sharing to context menu

This commit is contained in:
TC
2026-06-14 19:36:27 +10:00
parent 223b583f18
commit 6353c4151d
2 changed files with 10 additions and 11 deletions

View File

@@ -1165,16 +1165,6 @@ export function MarkdownEditor(): JSX.Element {
</span>
)
})()}
<button
className="statusbar-share-btn"
onClick={async () => {
const fileName = activeFilePath.split('/').pop()?.replace(/\.md$/, '') ?? 'document'
await window.api.exportPDF(activeFileContent, fileName)
}}
title="Export document as PDF"
>
</button>
</div>
</div>
)}

View File

@@ -190,7 +190,16 @@ export function FileTreeNode({ node, depth, dirPath, siblings }: Props): JSX.Ele
]
: [
{ label: 'Rename', action: startRename },
{ label: 'Delete', action: submitDelete, danger: true }
{ label: 'Delete', action: submitDelete, danger: true },
'separator',
{
label: 'Export as PDF',
action: async () => {
const content = await window.api.readFile(node.path)
const fileName = node.name.replace(/\.md$/, '')
await window.api.exportPDF(content, fileName)
}
}
]
if (node.type === 'directory') {