'use client'; import { Calendar, Target, TrendingUp, Clock, FileBarChart } from 'lucide-react'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; interface Template { id: string; name: string; description: string; type: 'weekly' | 'monthly' | 'project' | 'habit' | 'custom'; icon: React.ComponentType<{ className?: string }>; content: string; } const templates: Template[] = [ { id: 'weekly', name: 'Weekly Summary', description: 'Review your tasks, habits, and time from the past week', type: 'weekly', icon: Calendar, content: `

Weekly Summary

Overview

Week of [DATE_RANGE]

Tasks Completed

Habits Tracked

Time Logged

Total: [TIME_TOTAL]

Reflections

What went well this week?

What could be improved?

Goals for next week:

`, }, { id: 'monthly', name: 'Monthly Review', description: 'Comprehensive review of the past month', type: 'monthly', icon: Calendar, content: `

Monthly Review

Month of [DATE_RANGE]

Key Achievements

Project Progress

Habit Consistency

[HABIT_ANALYSIS]

Time Distribution

[TIME_BREAKDOWN]

Lessons Learned

What worked well?

What didn't work?

Next Month's Focus

Priorities:

Goals:

`, }, { id: 'project', name: 'Project Health', description: 'Status and progress report for a specific project', type: 'project', icon: Target, content: `

Project Health Report

[PROJECT_NAME]

Status Overview

Progress: [PROGRESS]%

Tasks: [COMPLETED] / [TOTAL]

Due: [DUE_DATE]

Milestones

Recent Activity

Risks & Blockers

[RISKS]

Next Steps

`, }, { id: 'habit', name: 'Habit Analysis', description: 'Deep dive into habit performance and trends', type: 'habit', icon: TrendingUp, content: `

Habit Analysis

Period: [DATE_RANGE]

Overall Performance

Completion rate: [COMPLETION_RATE]%

Active streaks: [STREAK_COUNT]

Top Performing Habits

  1. [TOP_HABITS]

Habits Needing Attention

Trends & Patterns

[TREND_ANALYSIS]

Recommendations

`, }, { id: 'time', name: 'Time Audit', description: 'Breakdown of where your time went', type: 'custom', icon: Clock, content: `

Time Audit

Period: [DATE_RANGE]

Total Time Tracked

[TOTAL_TIME]

By Domain

By Project

By Category

Insights

Where did most time go?

Was time aligned with priorities?

Adjustments for next period:

`, }, ]; interface ReportTemplatesProps { onSelect: (template: Template) => void; onCancel: () => void; } export function ReportTemplates({ onSelect, onCancel }: ReportTemplatesProps) { return (

Choose a Template

Start with a template or create from scratch

{templates.map((template) => ( onSelect(template)} onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onSelect(template); } }} tabIndex={0} role="listitem" aria-label={`Use template: ${template.name}`} >
{template.name}

{template.description}

))} {/* Custom template */} onSelect({ id: 'custom', name: 'Custom Report', description: 'Start with a blank report', type: 'custom', icon: FileBarChart, content: '

Custom Report

Start writing...

', }) } onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onSelect({ id: 'custom', name: 'Custom Report', description: 'Start with a blank report', type: 'custom', icon: FileBarChart, content: '

Custom Report

Start writing...

', }); } }} tabIndex={0} role="listitem" aria-label="Start with a blank custom report" >
Custom Report

Start with a blank report

); }