import 'package:flutter/material.dart';
import 'package:sigap/src/utils/constants/colors.dart';
import 'package:sigap/src/utils/constants/sizes.dart';

class FormSectionHeader extends StatelessWidget {
  final String title;
  final String? subtitle;
  final String? additionalText;

  const FormSectionHeader({
    super.key,
    required this.title,
    this.subtitle,
    this.additionalText,
  });

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text(
          title,
          style: TextStyle(
            fontSize: TSizes.fontSizeLg,
            fontWeight: FontWeight.bold,
            color: Theme.of(context).textTheme.bodyLarge?.color,
          ),
        ),
        if (subtitle != null) ...[
          const SizedBox(height: TSizes.sm),
          Text(
            subtitle!,
            style: Theme.of(
              context,
            ).textTheme.bodyMedium?.copyWith(color: TColors.textSecondary),
          ),
        ],
        if (additionalText != null) ...[
          const SizedBox(height: TSizes.xs),
          Text(
            additionalText!,
            style: Theme.of(context).textTheme.bodySmall?.copyWith(
              fontStyle: FontStyle.italic,
              color: TColors.textSecondary,
            ),
          ),
        ],
        const SizedBox(height: TSizes.spaceBtwItems),
      ],
    );
  }
}
