import 'package:cims_apps/application/theme/color_palette.dart';
import 'package:flutter/material.dart';

class TextCaption extends StatelessWidget {
  final String title, subtitle;
  final TextAlign? textAlignSubtitle;
  final CrossAxisAlignment? crossAxisAlignment;
  const TextCaption({
    Key? key,
    required this.title,
    this.subtitle = '',
    this.textAlignSubtitle,
    this.crossAxisAlignment,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(bottom: 32.0),
      child: Column(
        crossAxisAlignment: crossAxisAlignment ?? CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Text(
            title,
            style: const TextStyle(
              fontSize: 24,
              fontWeight: FontWeight.w700,
              color: ColorPalette.slate800,
            ),
          ),
          subtitle.isNotEmpty
              ? Padding(
                  padding: const EdgeInsets.only(top: 8.0),
                  child: Text(
                    subtitle,
                    textAlign: textAlignSubtitle ?? TextAlign.start,
                    style: const TextStyle(
                      fontSize: 16,
                      fontWeight: FontWeight.w500,
                      color: ColorPalette.slate500,
                    ),
                  ),
                )
              : const SizedBox(),
        ],
      ),
    );
  }
}
