import 'package:flutter/material.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/extension/build_context_x.dart';

class CommunityTemplateCell extends StatelessWidget {
  const CommunityTemplateCell({
    super.key,
    required this.onTap,
    required this.title,
  });

  final void Function() onTap;
  final Widget title;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Column(
        spacing: 8,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Expanded(
            child: AspectRatio(
              aspectRatio: 2.0,
              child: Container(
                decoration: ShapeDecoration(
                  shape: RoundedRectangleBorder(
                    side: const BorderSide(
                      width: 4,
                      strokeAlign: BorderSide.strokeAlignOutside,
                      color: ColorsManager.borderColor,
                    ),
                    borderRadius: BorderRadius.circular(5),
                  ),
                ),
              ),
            ),
          ),
          DefaultTextStyle(
            style: context.textTheme.bodyLarge!.copyWith(
              color: ColorsManager.blackColor,
            ),
            child: title,
          ),
        ],
      ),
    );
  }
}
