import 'package:flutter/material.dart';

import '../../about/internal/application/TextType.dart';
import '../../utils/Colors.dart';
import '../Component.dart';

/// The only way display copy is rendered. Raw Text/TextStyle is never used for
/// user-facing copy.
Widget text(
  String text,
  double textSize,
  TextType type, {
  Color? color,
  TextAlign? align,
  int? maxLines,
  TextOverflow? overflow,
  double? letterSpacing,
  double? height,
  double? wordSpacing,
  TextDecoration? decoration,
  FontWeight? weight,
}) {
  return Text(
    text,
    textAlign: align ?? TextAlign.left,
    maxLines: maxLines,
    overflow: overflow,
    style: TextStyle(
      decoration: decoration ?? TextDecoration.none,
      color: color ?? colorPrimaryDark,
      fontSize: textSize,
      fontFamily: getTextType(type),
      letterSpacing: letterSpacing,
      height: height,
      wordSpacing: wordSpacing,
      fontWeight: weight,
    ),
  );
}
