import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/spaces_management/all_spaces/widgets/sidebar_add_community_button.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';
import 'package:syncrow_web/utils/style.dart';

class SidebarHeader extends StatelessWidget {
  const SidebarHeader({
    required this.onAddCommunity,
    super.key,
  });

  final void Function() onAddCommunity;

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: subSectionContainerDecoration,
      padding: const EdgeInsets.all(16),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Text(
            'Communities',
            style: context.textTheme.titleMedium?.copyWith(
              color: ColorsManager.blackColor,
            ),
          ),
          SidebarAddCommunityButton(
            onTap: onAddCommunity,
          ),
        ],
      ),
    );
  }
}
