1- <!--
1+ <!--
22 Copyright 2025 Google LLC
33
44 Licensed under the Apache License, Version 2.0 (the "License");
1313 See the License for the specific language governing permissions and
1414 limitations under the License.
1515-->
16+ < div class ="coffee-chat-page ">
17+ < div class ="centered-chat-column ">
18+ < div class ="order-bar ">
19+ < mat-expansion-panel
20+ class ="order-expansion-panel "
21+ [expanded] ="chatService.order().length > 0 "
22+ >
23+ < mat-expansion-panel-header class ="order-panel-header ">
24+ < mat-panel-title class ="order-title-in-header ">
25+ Your order @if (chatService.order().length > 0) {
26+ < span
27+ > ({{ chatService.order().length }} item{{
28+ chatService.order().length === 1 ? "" : "s"
29+ }})</ span
30+ >
31+ }
32+ </ mat-panel-title >
33+ </ mat-expansion-panel-header >
1634
17- < div class ="chat center ">
18- < div class ="contact bar ">
19- < div class ="pic coffee "> </ div >
20- < div class ="name "> Chat with your AI Barista</ div >
21- < div class ="seen "> Today at 11:11am</ div >
22- </ div >
23- < div id ="chat " class ="messages ">
24- @if (chatService.loading()) {
25- < div class ="message barista ">
26- < div class ="typing typing-1 "> </ div >
27- < div class ="typing typing-2 "> </ div >
28- < div class ="typing typing-3 "> </ div >
29- </ div >
30- }
31- @for (entry of chatService.history(); track entry; let i = $index) {
35+ < div class ="order-details-content ">
36+ < div class ="order-text-actual ">
37+ {{ currentOrder() }}
38+ </ div >
39+ </ div >
40+ </ mat-expansion-panel >
41+ </ div >
42+
43+ < div class ="chat-content-area ">
44+ < div id ="chat " class ="messages ">
45+ @if (chatService.loading()) {
46+ < div class ="message barista ">
47+ < div class ="message-icon-container ">
48+ < mat-icon class ="barista-icon "> coffee</ mat-icon >
49+ </ div >
50+ < div class ="message-text-container typing-indicator ">
51+ < div class ="typing typing-1 "> </ div >
52+ < div class ="typing typing-2 "> </ div >
53+ < div class ="typing typing-3 "> </ div >
54+ </ div >
55+ </ div >
56+ } @for (entry of chatService.history(); track entry; let i = $index) {
3257 @if (entry.role === 'user') {
33- < div class ="message user ">
58+ < div class ="message user ">
59+ < div class ="message-text-container ">
3460 {{ entry.text }}
3561 @if (entry.media && entry.media.downloadUrl) {
36- < img [src] ="entry.media.downloadUrl ">
62+ < img [src] ="entry.media.downloadUrl " alt =" User media " / >
3763 }
3864 </ div >
39- }
40- @if (entry.role === 'agent') {
41- < div class ="message barista ">
65+ </ div >
66+ } @if (entry.role === 'agent') {
67+ < div class ="message barista ">
68+ < div class ="message-icon-container ">
69+ < mat-icon class ="barista-icon "> coffee</ mat-icon >
70+ </ div >
71+ < div class ="message-text-container ">
4272 {{ entry.text }}
4373 </ div >
74+ </ div >
75+ } }
76+ </ div >
77+ </ div >
78+ < div class ="suggestions-container ">
79+ < div class ="quick-replies ">
80+ @for (response of chatService.suggestedResponses(); track response; let
81+ index = $index) {
82+ < button
83+ mat-stroked-button
84+ class ="quick-reply-chip "
85+ (click) ="ask(response) "
86+ >
87+ < mat-icon fontSet ="material-symbols-outlined "
88+ > prompt_suggestion</ mat-icon
89+ > {{ response }}
90+ </ button >
4491 }
45- }
46- < div class ="time "> Today at 11:11am</ div >
47- </ div >
48- < form class ="input ">
49- < div class ="help ">
92+ </ div >
93+ </ div >
94+ < form class ="chat-input-bar " (ngSubmit) ="ask() ">
5095 @if (chatService.error()) {
51- < pre class ="error "> {{ chatService.error()?.text }}</ pre >
96+ < pre class ="error-message "> {{ chatService.error()?.text }}</ pre >
5297 }
53- @for (response of chatService.suggestedResponses(); track response; let index = $index) {
54- < button (click) ="ask(response) " mat-flat-button > {{ response }}</ button >
55- }
56- </ div >
57- < div class ="forms ">
58- < mat-form-field class ="form-field " appearance ="outline ">
59- < mat-label > Chat with our agent</ mat-label >
60- < textarea
98+
99+ < mat-form-field appearance ="outline " class ="chat-input-field ">
100+ < input
61101 matInput
62102 (keypress) ="keyPress($event) "
63103 [formControl] ="chatFormControl "
64- placeholder ="Type a message... " >
65- </ textarea >
104+ placeholder ="Anything else? "
105+ / >
66106 @if (mediaStorageService.media()) {
67- < img [src] ="mediaStorageService.media()?.downloadUrl " class ="media-preview ">
107+ < img
108+ [src] ="mediaStorageService.media()?.downloadUrl "
109+ class ="media-preview-small "
110+ alt ="Media preview "
111+ />
68112 }
69113 </ mat-form-field >
70- < div class ="action-grid ">
71- < button mat-icon-button (click) ="ask() " [disabled] ="chatService.loading() || !chatFormControl.value "> < mat-icon > send</ mat-icon > </ button >
72- < div > </ div >
73- < button mat-icon-button (click) ="confirmOrder() " [disabled] ="chatService.loading() "> < mat-icon > coffee</ mat-icon > </ button >
74- < button mat-icon-button (click) ="file_input.click() " [disabled] ="chatService.loading() ">
75- < mat-icon > add_a_photo</ mat-icon >
76- < input #file_input type ="file " accept ="image/* " style ="display:none " (change) ="setFileData($event) ">
77- </ button >
78- </ div >
79- </ div >
80- </ form >
81- </ div >
114+
115+ < button
116+ mat-icon-button
117+ class ="action-button add-btn "
118+ type ="button "
119+ (click) ="file_input.click() "
120+ [disabled] ="chatService.loading() "
121+ matTooltip ="Add attachment "
122+ >
123+ < mat-icon > add</ mat-icon >
124+ < input
125+ #file_input
126+ type ="file "
127+ accept ="image/* "
128+ style ="display: none "
129+ (change) ="setFileData($event) "
130+ />
131+ </ button >
132+
133+ < button
134+ mat-icon-button
135+ class ="action-button send-btn "
136+ type ="submit "
137+ [disabled] ="chatService.loading() || !chatFormControl.value "
138+ matTooltip ="Send message "
139+ >
140+ < mat-icon > chevron_right</ mat-icon >
141+ </ button >
142+ </ form >
143+ </ div >
144+ </ div >
0 commit comments