import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:satu/shared/app_colors.dart';
import 'package:satu/shared/shared_styles.dart';
import 'package:satu/shared/ui_helpers.dart';

class AddCategoryListItem extends StatelessWidget {
  final String name;
  final Function? onPress;

  const AddCategoryListItem({Key? key, this.name = '', this.onPress})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: const BoxDecoration(color: whiteColor),
      child: ListTile(
        onTap: () => onPress!(),
        contentPadding:
            const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
        title: Padding(
          padding: const EdgeInsets.only(top: 4.0),
          child: Container(
              height: 50,
              child: Center(
                child: Text(
                  name,
                  style: const TextStyle(
                      fontWeight: FontWeight.w600,
                      color: Colors.black,
                      fontSize: 15),
                  overflow: TextOverflow.ellipsis,
                  maxLines: 3,
                ),
              )),
        ),
        trailing: Icon(
          Icons.arrow_right,
          color: primaryColor,
        ),
      ),
    );
  }
}
