import 'package:flutter/material.dart';

import '../../../../common/theme/theme.dart';
import '../../../components/spacer/spacer.dart';
import 'activity_tile.dart';

class HomeActivity extends StatelessWidget {
  const HomeActivity({super.key});

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.symmetric(
        vertical: 24,
        horizontal: AppValue.padding,
      ).copyWith(bottom: 0),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              const Text(
                'Aktivitas Terkini',
                style: TextStyle(
                  fontSize: 22,
                  fontWeight: FontWeight.w700,
                  color: AppColor.textPrimary,
                  letterSpacing: -0.5,
                ),
              ),
              TextButton.icon(
                onPressed: () {},
                icon: const Icon(Icons.arrow_forward_rounded, size: 16),
                label: const Text('Lihat Semua'),
                style: TextButton.styleFrom(
                  foregroundColor: AppColor.primary,
                  textStyle: const TextStyle(
                    fontWeight: FontWeight.w600,
                    fontSize: 14,
                  ),
                ),
              ),
            ],
          ),
          const SpaceHeight(16),
          Container(
            decoration: BoxDecoration(
              color: AppColor.white,
              borderRadius: BorderRadius.circular(16),
              border: Border.all(color: AppColor.border.withOpacity(0.5)),
              boxShadow: [
                BoxShadow(
                  color: Colors.black.withOpacity(0.04),
                  blurRadius: 20,
                  offset: const Offset(0, 8),
                ),
              ],
            ),
            child: Column(
              children: [
                HomeActivityTile(
                  title: 'Transaksi Berhasil',
                  subtitle: 'Kasir-01 • Rp 125.000',
                  time: '2 menit lalu',
                  icon: Icons.check_circle_rounded,
                  color: AppColor.success,
                  isHighlighted: true,
                ),
                const Divider(height: 1, color: AppColor.border),
                HomeActivityTile(
                  title: 'Stok Menipis',
                  subtitle: 'Kopi Arabica • 5 unit tersisa',
                  time: '15 menit lalu',
                  icon: Icons.warning_amber_rounded,
                  color: AppColor.warning,
                  isHighlighted: false,
                ),
                const Divider(height: 1, color: AppColor.border),
                HomeActivityTile(
                  title: 'Login Kasir',
                  subtitle: 'Sari masuk shift pagi',
                  time: '1 Jam lalu',
                  icon: Icons.login_rounded,
                  color: AppColor.info,
                  isHighlighted: false,
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
