Untitled
unknown
plain_text
2 years ago
1.8 kB
10
Indexable
// yumanTODO
let bizView = BizChatCopilotFREView.withAutoLayout()
view.addSubview(bizView)
let title = "Hi Kat,\n\nHere are some examples to get started..."
let traits: [[BizChatCopilotFREItemTrait]] = [
[
.icon(TeamsUIIconAppBundle.IconSymbol.list),
.title("Catch up"),
.content(text: "Review key points from file", boldRanges: [NSRange(location: 23, length: 4)])
],
[
.icon(TeamsUIIconAppBundle.IconSymbol.edit),
.title("Create"),
.content(text: "Draft an email with action items from meeting", boldRanges: [NSRange(location: 38, length: 7)])
],
[
.icon(TeamsUIIconAppBundle.IconSymbol.chatBubblesQuestion),
.title("Ask"),
.content(text: "When is next meeting with people?", boldRanges: [NSRange(location: 26, length: 6)]),
.badge("NEW")
]
]
let callback = BizChatCopilotFRECallback { index in
print("yuman item \(index)")
} onTapBadge: { index in
print("yuman badge \(index)")
}
let ttt: [BizChatCopilotFRETrait] = [
.title(title),
.item(traits[0]),
.item(traits[1]),
.item(traits[2])
]
bizView.apply(viewData: .init(traits: ttt), callback: callback)
bizView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 17).isActive = true
bizView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -17).isActive = true
bizView.topAnchor.constraint(equalTo: view.topAnchor, constant: 17).isActive = true
[bodyView, bottomContainerView].forEach({ $0.isHidden = true })
// yumanTODO endEditor is loading...