import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
import 'package:flutter/material.dart';

import '../../../core/components/search_input.dart';
import '../../../core/constants/colors.dart';

class HomeTitle extends StatelessWidget {
  final TextEditingController controller;
  final Function(String value)? onChanged;

  const HomeTitle({
    super.key,
    required this.controller,
    this.onChanged,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      height: context.deviceHeight * 0.1,
      padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
      decoration: BoxDecoration(
        color: AppColors.white,
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          const Text(
            'DEFAULT OUTLET',
            style: TextStyle(
              color: AppColors.primary,
              fontSize: 28,
              fontWeight: FontWeight.w600,
            ),
          ),
          SizedBox(
            width: 300.0,
            child: SearchInput(
              controller: controller,
              onChanged: onChanged,
              hintText: 'Search..',
            ),
          ),
        ],
      ),
    );
  }
}
