import 'package:flutter/material.dart';

import 'package:pweb/controllers/dashboard/balance/carousel.dart';
import 'package:pweb/pages/dashboard/buttons/balance/indicator.dart';


class BalanceCarouselNavigation extends StatelessWidget {
  final BalanceCarouselController controller;
  final int index;

  const BalanceCarouselNavigation({
    super.key,
    required this.controller,
    required this.index,
  });

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        IconButton(
          onPressed: index > 0 ? controller.goBack : null,
          icon: const Icon(Icons.arrow_back),
        ),
        const SizedBox(width: 16),
        CarouselIndicator(itemCount: controller.items.length, index: index),
        const SizedBox(width: 16),
        IconButton(
          onPressed: index < controller.items.length - 1
              ? controller.goForward
              : null,
          icon: const Icon(Icons.arrow_forward),
        ),
      ],
    );
  }
}
