Add DOCX export endpoint and Export button
- GET /api/export generates a Word document with all non-archived prayers - Accepts ?status=active|answered|all and ?tag= query params to match the current filter/tag selection in the UI - Document sections: Active Prayers + Answered Prayers with page break, each prayer showing person, request, answer, dates, and tags - Styled with Palatino Linotype, page numbers in footer - Export button in the toolbar triggers download of dated .docx file Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DReRqHxSYuVfCzTzQGD9hZ
This commit is contained in:
5 files changed
+383
-3
No files matched your search
+11
@@ -103,6 +103,13 @@ export default function App() {
|
||||
setActiveTag(prev => prev === tag ? null : tag);
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
const params = new URLSearchParams();
|
||||
params.set('status', filter);
|
||||
if (activeTag) params.set('tag', activeTag);
|
||||
window.location.href = `/api/export?${params.toString()}`;
|
||||
}
|
||||
|
||||
const emptyMessage = search
|
||||
? `No results for "${search}".`
|
||||
: activeTag
|
||||
@@ -167,6 +174,10 @@ export default function App() {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button className="btn btn-export" onClick={handleExport} title="Export to Word">
|
||||
↓ Export
|
||||
</button>
|
||||
|
||||
<div className="search-wrap">
|
||||
<span className="search-icon">⌕</span>
|
||||
<input
|
||||
|
||||
Reference in new issue
Block a user