|
2 | 2 |
|
3 | 3 | import { useState, useEffect } from 'react'; |
4 | 4 | import { Button } from '@/components/ui/button'; |
| 5 | +import { Checkbox } from '@/components/ui/checkbox'; |
5 | 6 | import { |
6 | 7 | Dialog, |
7 | 8 | DialogContent, |
@@ -40,6 +41,7 @@ export function ExportDailyBriefingDialog({ open, onOpenChange }: ExportDialogPr |
40 | 41 | const [isExporting, setIsExporting] = useState(false); |
41 | 42 | const [approvedEntries, setApprovedEntries] = useState<MorningMeetingEntry[]>([]); |
42 | 43 | const [isLoadingEntries, setIsLoadingEntries] = useState(false); |
| 44 | + const [includeImages, setIncludeImages] = useState(true); |
43 | 45 |
|
44 | 46 | useEffect(() => { |
45 | 47 | const loadEntriesForDate = async () => { |
@@ -83,6 +85,14 @@ export function ExportDailyBriefingDialog({ open, onOpenChange }: ExportDialogPr |
83 | 85 | for (const entry of entriesForDate) { |
84 | 86 | let html = entry.entry; |
85 | 87 |
|
| 88 | + // Skip image processing if includeImages is false |
| 89 | + if (!includeImages) { |
| 90 | + // Remove all image tags from HTML |
| 91 | + html = html.replace(/<img[^>]*>/gi, ''); |
| 92 | + entry.entry = html; |
| 93 | + continue; |
| 94 | + } |
| 95 | + |
86 | 96 | console.log('Processing entry:', entry.id, 'with', entry.images?.length || 0, 'tracked images'); |
87 | 97 |
|
88 | 98 | // Only process if there are tracked images (uploaded via the editor) |
@@ -399,7 +409,7 @@ export function ExportDailyBriefingDialog({ open, onOpenChange }: ExportDialogPr |
399 | 409 | spacing: { before: 400 }, |
400 | 410 | children: [ |
401 | 411 | new TextRun({ |
402 | | - text: `Morning Briefing of the ${new Date().toLocaleString('en-US')}`, |
| 412 | + text: `Exported on ${new Date().toLocaleString('en-US')}`, |
403 | 413 | italics: true, |
404 | 414 | font: 'Roboto', |
405 | 415 | }), |
@@ -462,6 +472,20 @@ export function ExportDailyBriefingDialog({ open, onOpenChange }: ExportDialogPr |
462 | 472 | </div> |
463 | 473 | </div> |
464 | 474 |
|
| 475 | + <div className="flex items-center space-x-2"> |
| 476 | + <Checkbox |
| 477 | + id="include-images" |
| 478 | + checked={includeImages} |
| 479 | + onCheckedChange={(checked) => setIncludeImages(checked as boolean)} |
| 480 | + /> |
| 481 | + <label |
| 482 | + htmlFor="include-images" |
| 483 | + className="text-sm font-medium text-foreground cursor-pointer" |
| 484 | + > |
| 485 | + Include images in export |
| 486 | + </label> |
| 487 | + </div> |
| 488 | + |
465 | 489 | <div className="space-y-2"> |
466 | 490 | <label className="text-sm font-medium text-foreground"> |
467 | 491 | Approved Entries ({approvedEntries.length}) |
|
0 commit comments