import { useState } from 'react' import type { CronTask } from '../../types/task' import { TaskRow } from './TaskRow' import { useTranslation } from '../../i18n' type Props = { tasks: CronTask[] } export function TaskList({ tasks }: Props) { const t = useTranslation() const enabledCount = tasks.filter((task) => task.enabled).length const [expandedLogsId, setExpandedLogsId] = useState(null) return (
{/* Stats */}
{/* Task rows — accordion: only one logs panel open at a time */}
{tasks.map((task) => ( setExpandedLogsId(expandedLogsId === task.id ? null : task.id)} /> ))}
) } function StatCard({ label, value }: { label: string; value: string }) { return (
{value}
{label}
) }