import { useState } from 'react' import { useI18n } from '../i18n' export default function Dashboard({ api, onRescan }) { const { t, layout } = useI18n() const [notifications, setNotifications] = useState([]) const addNotif = (text, type) => { setNotifications(prev => [{ text, type, id: Date.now(), time: new Date() }, ...prev]) } return (
{t('studio.workflows')}
{t('studio.workflows')}
{t('studio.noWorkflow')}
{t('studio.activeAgents')}
{t('studio.noWorkflow')}
{t('dashboard.activityLog')}
{notifications.length > 0 && ( {notifications.length} )}
{notifications.length === 0 ? (
{t('dashboard.noUpdateData')}
) : (
{notifications.map(n => (
{n.time.toLocaleTimeString(layout.locale, { hour: '2-digit', minute: '2-digit', second: '2-digit' })} {n.text}
))}
)}
) }