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';

class AlertScreen extends ConsumerStatefulWidget {
  const AlertScreen({super.key});

  @override
  ConsumerState<AlertScreen> createState() => AlertScreenState();
}

class AlertScreenState extends ConsumerState<AlertScreen> {
  final activity = [
    {"type": "goal"},
    {"type": "wage", "amount": 5},
    {"type": "lock"},
    {"type": "lock"},
  ];
  bool edit = false;

  @override
  void initState() {
    edit = false;
    super.initState();
  }

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

    return Scaffold(
      backgroundColor: theme.getColorFor(ThemeCode.backgroundSecondary),
      body: Container(
        margin: EdgeInsets.all(30),
        child: Column(
          children: [
            Row(
              children: [
                Text("Alertas"),
                Spacer(),
                TextButton(
                  onPressed: () => setState(() {
                    edit = !edit;
                  }),
                  child: Text("Editar"),
                ),
              ],
            ),
            ActivityList(activity: activity, edit: edit),
          ],
        ),
      ),
    );
  }
}
