vds_ios/VDS/Components/TitleLockup/TitleLockupEyebrowModel.swift
Matt Bruce aa013f62e3 added equatable to structs
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-08-26 09:03:17 -05:00

59 lines
2.1 KiB
Swift

//
// TitleLockupEyebrowModel.swift
// VDS
//
// Created by Matt Bruce on 1/6/23.
//
import Foundation
extension TitleLockup {
/// Model that represents the options available for the eyebrow label.
public struct EyebrowModel: Equatable {
/// Text that will be used for the eyebrow label.
public var text: String
/// Text color that will be used for the eyebrow label
public var textColor: TextColor
/// Used in combination with standardStyle to set the textStyle that will be used for the eyebrow label.
public var isBold: Bool
/// Array of LabelAttributeModel objects used in rendering the text in the eyebrow label.
public var textAttributes: [any LabelAttributeModel]?
/// Standard style that will be used for the eyebrow label.
public var standardStyle: OtherStandardStyle
/// Number of lines that will be used for the eyebrow label.
public var numberOfLines: Int
public init(text: String,
textColor: TextColor = .primary,
isBold: Bool = true,
standardStyle: OtherStandardStyle = .bodyLarge,
textAttributes: [any LabelAttributeModel]? = nil,
numberOfLines: Int = 0) {
self.text = text
self.textColor = textColor
self.isBold = isBold
self.standardStyle = standardStyle
self.textAttributes = textAttributes
self.numberOfLines = numberOfLines
}
/// Text style that will be used for the eyebrow label.
public var textStyle: TextStyle { isBold ? standardStyle.value.bold : standardStyle.value.regular }
public static func == (lhs: TitleLockup.EyebrowModel, rhs: TitleLockup.EyebrowModel) -> Bool {
lhs.text == rhs.text
&& lhs.textColor == rhs.textColor
&& lhs.isBold == rhs.isBold
&& lhs.standardStyle == rhs.standardStyle
&& lhs.textAttributes == rhs.textAttributes
&& lhs.numberOfLines == rhs.numberOfLines
}
}
}