This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1551bfe
commit c67f887
Showing
4 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/RookieShop.StoreFront/Components/Chatbot/Chatbot.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@using Microsoft.SemanticKernel | ||
@using RookieShop.Storefront.Areas.Basket.Services | ||
@using RookieShop.Storefront.Areas.Product.Services | ||
@inject IProductService ProductService | ||
@inject IBasketService BasketService | ||
@inject IHttpContextAccessor HttpContextAccessor | ||
@inject ILoggerFactory LoggerFactory | ||
@inject IServiceProvider ServiceProvider | ||
|
||
<h3>Chatbot</h3> | ||
|
||
@code { | ||
ChatState? _chatState; | ||
bool _missingConfiguration; | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
var kernel = ServiceProvider.GetService<Kernel>(); | ||
if (kernel is not null) | ||
{ | ||
_chatState = new(ProductService, BasketService, HttpContextAccessor, kernel, LoggerFactory); | ||
} | ||
else | ||
{ | ||
_missingConfiguration = true; | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/RookieShop.StoreFront/Components/Chatbot/ShowChatbotButton.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="fixed bottom-0 right-0 mb-4 mr-4"> | ||
<button id="open-chat" class="text-white bg-blue-700 hover:bg-blue-800 rounded-lg focus:ring-4 py-2 px-4 transition duration-300 flex items-center"> | ||
Chat with Bot | ||
</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters