using Telerik.Maui.Controls.Chat;

namespace MauiApp6
{
    public class CustomChatItemTemplateSelector : ChatItemTemplateSelector
    {
        public DataTemplate ImportantMessageTemplate { get; set; }

        protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
        {
            ChatItem chatItem = item as ChatItem;
            var myItem = chatItem?.Data as SimpleChatItem;
            if (myItem != null && myItem.Category == MessageCategory.Important)
            {
                return this.ImportantMessageTemplate;
            }
            return base.OnSelectTemplate(item, container);
        }
    }
}
