feat: daily timeline advanced UI and calendar integration
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Download, Loader2, X, Clock, CheckCircle, AlertCircle, FileVideo, Image as ImageIcon } from 'lucide-react';
|
||||
import { Download, Loader2, X, Clock, CheckCircle, AlertCircle, FileVideo, Image as ImageIcon, FolderOpen } from 'lucide-react';
|
||||
|
||||
interface RenderJob {
|
||||
id: string;
|
||||
@@ -9,6 +9,7 @@ interface RenderJob {
|
||||
width: number;
|
||||
height: number;
|
||||
downloadUrl?: string;
|
||||
targetPath?: string;
|
||||
error?: string;
|
||||
createdAt: number;
|
||||
completedAt?: number;
|
||||
@@ -18,13 +19,14 @@ interface RenderJob {
|
||||
interface RenderHistoryPanelProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
onDownload?: (job: RenderJob) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* RenderHistoryPanel — Shows past and active render jobs with progress,
|
||||
* download links, and job status information.
|
||||
*/
|
||||
export const RenderHistoryPanel: React.FC<RenderHistoryPanelProps> = ({ isOpen, onClose }) => {
|
||||
export const RenderHistoryPanel: React.FC<RenderHistoryPanelProps> = ({ isOpen, onClose, onDownload = () => {} }) => {
|
||||
const [jobs, setJobs] = useState<RenderJob[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
@@ -160,15 +162,23 @@ export const RenderHistoryPanel: React.FC<RenderHistoryPanelProps> = ({ isOpen,
|
||||
|
||||
{/* Download button */}
|
||||
{job.status === 'done' && job.downloadUrl && (
|
||||
<a
|
||||
href={job.downloadUrl}
|
||||
download
|
||||
title="Descargar"
|
||||
className="flex items-center gap-1 px-2 py-1 bg-emerald-600/20 text-emerald-300 rounded hover:bg-emerald-600/30 transition-colors"
|
||||
<button
|
||||
onClick={() => {
|
||||
if ((window as any).electronAPI && job.targetPath) {
|
||||
(window as any).electronAPI.fs.showItemInFolder(job.targetPath);
|
||||
} else {
|
||||
const a = document.createElement('a');
|
||||
a.href = job.downloadUrl!;
|
||||
a.download = `export-${job.id.slice(0, 8)}`;
|
||||
a.click();
|
||||
}
|
||||
}}
|
||||
title="Abrir en carpeta"
|
||||
className="p-1.5 rounded-lg bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20 transition-colors flex items-center gap-1.5"
|
||||
>
|
||||
<Download size={10} />
|
||||
<span>Descargar</span>
|
||||
</a>
|
||||
<FolderOpen size={12} />
|
||||
<span>Abrir en carpeta</span>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user