import 'package:flutter/material.dart';

import 'package:pweb/widgets/sidebar/destinations.dart';
import 'package:pweb/widgets/sidebar/side_menu.dart';
import 'package:pweb/widgets/sidebar/user.dart';


class PayoutSidebar extends StatelessWidget {
  const PayoutSidebar({
    super.key,
    required this.selected,
    required this.onSelected,
    this.onLogout,
    this.userName,
    this.avatarUrl,
  });

  final PayoutDestination selected;
  final ValueChanged<PayoutDestination> onSelected;
  final VoidCallback? onLogout;

  final String? userName;
  final String? avatarUrl;


  @override
  Widget build(BuildContext context) {
    final items = [
      PayoutDestination.dashboard,
      PayoutDestination.recipients,
      PayoutDestination.methods,
      PayoutDestination.reports,
    ];

    final theme = Theme.of(context);

    return Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        UserProfileCard(
          theme: theme, 
          avatarUrl: avatarUrl, 
          userName: userName, 
          selected: selected, 
          onSelected: onSelected
        ),
        const SizedBox(height: 8),
        SideMenuColumn(
          theme: theme,
          avatarUrl: avatarUrl,
          userName: userName,
          items: items,
          selected: selected,
          onSelected: onSelected,
        ),
      ],
    );
  }
}