import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:notifications/src/core/activity_list.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:sf_shared/sf_shared.dart';

class ActivityScreen extends ConsumerWidget {
  ActivityScreen({super.key});

  final activity = [
    {"type": "goal"},
    {"type": "wage", "amount": 5},
    {"type": "lock"},
    {"type": "lock"},
  ];

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final theme = ref.watch(themePortProvider);

    final content = [
      Text(
        "Movimientos recientes",
        style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30),
      ),
      Row(
        spacing: 20,
        children: [
          FilledButton(onPressed: () => {}, child: Text("Hoy")),
          Spacer(),
          TextButton(onPressed: () => {}, child: Text("Última semana")),
          TextButton(onPressed: () => {}, child: Text("Mes")),
        ],
      ),
      SizedBox(height: 200, child: LineGraph()),
      ActivityList(activity: activity, edit: false),
    ];

    return Scaffold(
      backgroundColor: theme.getColorFor(ThemeCode.backgroundSecondary),
      body: Container(
        margin: EdgeInsets.fromLTRB(30, 30, 30, 0),
        child: Center(
          child: ListView.separated(
            itemBuilder: (BuildContext context, int index) {
              return content[index];
            },
            separatorBuilder: (BuildContext context, int index) {
              return Divider(color: Colors.transparent, height: 30);
            },
            itemCount: content.length,
          ),
        ),
      ),
    );
  }
}
