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

class RoutineDialogFunctionListTile extends StatelessWidget {
  const RoutineDialogFunctionListTile({
    super.key,
    required this.iconPath,
    required this.operationName,
    required this.onTap,
  });

  final String iconPath;
  final String operationName;
  final void Function() onTap;

  @override
  Widget build(BuildContext context) {
    return ListTile(
      leading: SvgPicture.asset(
        iconPath,
        width: 24,
        height: 24,
        placeholderBuilder: (context) => const SizedBox(
          width: 24,
          height: 24,
        ),
      ),
      title: Text(
        operationName,
        style: context.textTheme.bodyMedium,
      ),
      trailing: const Icon(
        Icons.arrow_forward_ios,
        size: 16,
        color: ColorsManager.textGray,
      ),
      onTap: onTap,
    );
  }
}
