vds_ios/VDS/Components/Breadcrumbs/BreadcrumbItemModel.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

33 lines
958 B
Swift

//
// BreadcrumbItemModel.swift
// VDS
//
// Created by Kanamarlapudi, Vasavi on 20/03/24.
//
import Foundation
extension Breadcrumbs {
public struct BreadcrumbItemModel: Equatable {
///Text that goes in the breadcrumb item
public var text: String
/// The Breadcrumb link to links to its respective page.
public var selected: Bool
///Click event when you click on a breadcrumb item
public var onClick: ((BreadcrumbItem) -> Void)?
public init(text: String, selected: Bool = false, onClick: ((BreadcrumbItem) -> Void)? = nil) {
self.text = text
self.selected = selected
self.onClick = onClick
}
public static func == (lhs: Breadcrumbs.BreadcrumbItemModel, rhs: Breadcrumbs.BreadcrumbItemModel) -> Bool {
lhs.text == rhs.text
&& lhs.selected == rhs.selected
}
}
}