import React from 'react'; import { FeedSackLogEntry } from '../../types.ts'; import { SackIcon } from '../icons/Icons.tsx'; interface FeedActivityLogProps { data: FeedSackLogEntry[]; } const FeedActivityLog: React.FC = ({ data }) => { const formatDate = (date: Date) => { const today = new Date(); const yesterday = new Date(today); yesterday.setDate(yesterday.getDate() - 1); if (date.toDateString() === today.toDateString()) { return 'Hari Ini'; } if (date.toDateString() === yesterday.toDateString()) { return 'Kemarin'; } return date.toLocaleDateString('id-ID', { day: 'numeric', month: 'short' }); }; return (

Aktivitas Terbaru

{data.length > 0 ? (
{data.slice(0, 15).map((log) => (

{log.type === 'inbound' ? 'Karung Masuk Terdeteksi' : 'Karung Dituang Terdeteksi'}

{log.count} karung di {log.location}

{formatDate(log.timestamp)}
))}
) : (

Tidak ada aktivitas terdeteksi.

)}
); }; export default FeedActivityLog;