import 'package:flutter/material.dart';
import 'package:shadcn_ui/shadcn_ui.dart';

/// 공통 비고 입력 위젯
/// 여러 화면에서 재사용할 수 있도록 설계
class RemarkInput extends StatelessWidget {
  final TextEditingController controller;
  final String label;
  final String hint;
  final FormFieldValidator<String>? validator;
  final int minLines;
  final int? maxLines;
  final bool enabled;

  const RemarkInput({
    super.key,
    required this.controller,
    this.label = '비고',
    this.hint = '비고를 입력하세요',
    this.validator,
    this.minLines = 4,
    this.maxLines,
    this.enabled = true,
  });

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        if (label.isNotEmpty)
          Padding(
            padding: const EdgeInsets.only(bottom: 8.0),
            child: Text(
              label,
              style: const TextStyle(fontWeight: FontWeight.w500),
            ),
          ),
        ShadInput(
          controller: controller,
          placeholder: Text(hint),
          minLines: minLines,
          maxLines: maxLines ?? minLines + 2,
          enabled: enabled,
        ),
      ],
    );
  }
}
