import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:web_panel/utils/App_color.dart';

import '../../../constants.dart';

class SearchField extends StatelessWidget {
  SearchField({super.key, this.onChanged});

  void Function(String)? onChanged;

  @override
  Widget build(BuildContext context) {
    return TextField(
      onChanged: onChanged,
      onTapOutside: (event) {
        Focus.of(context).unfocus();
      },
      decoration: InputDecoration(
        hintText: "Search",
        fillColor: AppColor.secondaryColor,
        filled: true,
        border: OutlineInputBorder(
          borderSide: BorderSide(color: AppColor.primaryColor),
          borderRadius: const BorderRadius.all(Radius.circular(10)),
        ),
        // suffixIcon: InkWell(
        //   onTap: () {},
        //   child: Container(
        //     padding: EdgeInsets.all(defaultPadding * 0.75),
        //     margin: EdgeInsets.symmetric(horizontal: defaultPadding / 2),
        //     decoration: BoxDecoration(
        //       color: AppColor.primaryColor,
        //       borderRadius: const BorderRadius.all(Radius.circular(10)),
        //     ),
        //     child: SvgPicture.asset("assets/icons/Search.svg"),
        //   ),
        // ),
      ),
    );
  }
}
