3
3
- SPDX-License-Identifier: AGPL-3.0-or-later
4
4
-->
5
5
<template >
6
- <div class =" summary" >
7
- <div class =" summary__header" >
8
- <div class =" summary__header__actions" >
9
- <NcChip :icon-svg =" creation" no-close >
10
- {{ brand }}
11
- </NcChip >
12
- <NcButton :aria-label =" t('mail', 'Go to latest message')"
13
- type =" secondary"
14
- @click =" onScroll" >
15
- {{ t('mail', 'Go to newest message') }}
16
- <template #icon >
17
- <ArrowDownIcon :size =" 20" />
18
- </template >
19
- </NcButton >
6
+ <NcAssistantContent class =" wrapper" >
7
+ <div class =" summary" >
8
+ <div class =" summary__header" >
9
+ <div class =" summary__header__actions" >
10
+ <div class =" summary__header__info" >
11
+ <NcAssistantIcon class =" summary__header__icon" />
12
+ <div class =" summary__header__text" >
13
+ <div class =" summary__header__title" >
14
+ {{ t('mail', 'Thread summary') }}
15
+ </div >
16
+ <div class =" summary__header__brand" >
17
+ {{ brand }}
18
+ </div >
19
+ </div >
20
+ </div >
21
+
22
+ <NcButton :aria-label =" t('mail', 'Go to latest message')"
23
+ type =" tertiary-no-background"
24
+ @click =" onScroll" >
25
+ {{ t('mail', 'Newest message') }}
26
+ <template #icon >
27
+ <ArrowDownIcon :size =" 20" />
28
+ </template >
29
+ </NcButton >
30
+ </div >
20
31
</div >
21
- <div class =" summary__header__title" >
22
- <h2 >{{ t('mail', 'Thread summary') }}</h2 >
32
+ <div class =" summary__body" >
33
+ <LoadingSkeleton v-if =" loading" :number-of-lines =" 1" :with-avatar =" false" />
34
+ <p v-else >
35
+ {{ summary }}
36
+ </p >
37
+ </div >
38
+ <div class =" summary__notice" >
39
+ {{ t('mail', 'This summary is AI generated and may contain mistakes.') }}
23
40
</div >
24
41
</div >
25
- <div class =" summary__body" >
26
- <LoadingSkeleton v-if =" loading" :number-of-lines =" 1" :with-avatar =" false" />
27
- <p v-else >
28
- {{ summary }}
29
- </p >
30
- </div >
31
- </div >
42
+ </NcAssistantContent >
32
43
</template >
33
44
<script >
34
45
import ArrowDownIcon from ' vue-material-design-icons/ArrowDown.vue'
35
- import creation from ' @mdi/svg/svg/creation-outline.svg'
36
46
import NcButton from ' @nextcloud/vue/components/NcButton'
37
- import NcChip from ' @nextcloud/vue/components/NcChip'
47
+ import NcAssistantContent from ' @nextcloud/vue/components/NcAssistantContent'
48
+ import NcAssistantIcon from ' @nextcloud/vue/components/NcAssistantIcon'
38
49
import LoadingSkeleton from ' ./LoadingSkeleton.vue'
39
50
40
51
export default {
41
52
name: ' ThreadSummary' ,
42
53
components: {
43
54
LoadingSkeleton,
44
55
NcButton,
45
- NcChip,
46
56
ArrowDownIcon,
57
+ NcAssistantContent,
58
+ NcAssistantIcon,
47
59
},
48
60
props: {
49
61
summary: {
@@ -55,11 +67,6 @@ export default {
55
67
required: true ,
56
68
},
57
69
},
58
- data () {
59
- return {
60
- creation,
61
- }
62
- },
63
70
computed: {
64
71
brand () {
65
72
if (OCA .Theming ) {
@@ -81,47 +88,69 @@ export default {
81
88
}
82
89
</script >
83
90
<style lang="scss" scoped>
84
- .summary {
85
- border : 2px solid var (--color-primary-element );
86
- border-radius :var ( --border-radius-large ) ;
87
- margin : 0 10px 20px 10px ;
88
- padding : 10px ;
89
- display : flex ;
90
- flex-direction : column ;
91
+ .wrapper {
92
+ max-width : calc (100% - 20px );
93
+ margin : 0 auto ;
94
+ width : 100% ;
95
+ }
91
96
92
- & __header {
93
- display : flex ;
94
- flex-direction : column ;
95
- & __actions {
97
+ .summary {
98
+ position : relative ;
99
+ border-radius : var (--border-radius-large );
100
+ padding : 10px ;
101
+ display : flex ;
102
+ flex-direction : column ;
103
+ & __header {
104
+ display : flex ;
105
+ flex-direction : column ;
106
+
107
+ & __actions {
96
108
display : flex ;
97
109
justify-content : space-between ;
98
- & __brand {
99
- display : flex ;
100
- align-items : center ;
101
- background-color : var (--color-primary-light );
102
- border-radius : var (--border-radius-pill );
103
- width : fit-content ;
104
- padding-inline : 4px 10px ;
105
- margin : 8px 0 8px 0 ;
110
+ align-items : center ;
111
+ padding-bottom : 10px ;
112
+ }
106
113
107
- & __icon {
108
- color :var (--color-primary-element );
109
- margin-inline : 5px
110
- }
111
- }
112
- }
114
+ & __info {
115
+ display : flex ;
116
+ align-items : center ;
117
+ gap : var (--default-grid-baseline );
118
+ }
113
119
114
- }
120
+ & __text {
121
+ display : flex ;
122
+ flex-direction : column ;
123
+ line-height : 1.2 ;
124
+ }
125
+
126
+ & __title {
127
+ font-weight : bold ;
128
+ }
129
+
130
+ & __brand {
131
+ color : var (--color-text-maxcontrast );
132
+ }
133
+ & __icon {
134
+ padding-inline-end : 14px ;
135
+ }
136
+ }
137
+ & __body {
138
+ margin-inline-start : 35px ;
139
+ }
115
140
@media only screen and (max-width : 600px ) {
116
- .summary {
117
- & __header {
141
+ .summary {
142
+ & __header {
118
143
flex-direction : column ;
119
- & __actions {
144
+ & __actions {
120
145
flex-direction : column ;
121
146
}
122
147
}
123
148
}
124
149
}
150
+ .summary__notice {
151
+ margin-top : 0.5rem ;
152
+ margin-inline-start : 35px ;
153
+ color : var (--color-text-maxcontrast );
154
+ }
125
155
}
126
-
127
156
</style >
0 commit comments