11import { DragDropModule } from '@angular/cdk/drag-drop'
22import { CommonModule } from '@angular/common'
3- import { ChangeDetectionStrategy , Component , computed , inject , input } from '@angular/core'
3+ import { ChangeDetectionStrategy , Component , computed , inject , input , model } from '@angular/core'
44import { toSignal } from '@angular/core/rxjs-interop'
55import { FormsModule , ReactiveFormsModule } from '@angular/forms'
66import { RouterModule } from '@angular/router'
77import { CopilotChatMessage } from '@metad/copilot'
88import { AnalyticalCardModule } from '@metad/ocap-angular/analytical-card'
99import { NgmCommonModule } from '@metad/ocap-angular/common'
10+ import { NgmSelectionModule , SlicersCapacity } from '@metad/ocap-angular/selection'
11+ import { ISlicer } from '@metad/ocap-core'
1012import { NxWidgetKpiComponent } from '@metad/story/widgets/kpi'
1113import { TranslateModule } from '@ngx-translate/core'
1214import { MarkdownModule } from 'ngx-markdown'
@@ -32,6 +34,7 @@ import { ChatService } from '../chat.service'
3234 AvatarComponent ,
3335 ChatLoadingComponent ,
3436 AnalyticalCardModule ,
37+ NgmSelectionModule ,
3538 NxWidgetKpiComponent
3639 ] ,
3740 selector : 'pac-chat-component-message' ,
@@ -40,12 +43,18 @@ import { ChatService } from '../chat.service'
4043 changeDetection : ChangeDetectionStrategy . OnPush
4144} )
4245export class ChatComponentMessageComponent {
46+ SlicersCapacity = SlicersCapacity
47+
4348 readonly #store = inject ( Store )
4449 readonly chatService = inject ( ChatService )
4550
4651 readonly message = input < CopilotChatMessage > ( )
4752
4853 readonly data = computed ( ( ) => this . message ( ) ?. data as any )
54+ readonly _slicers = model < ISlicer [ ] > ( [ ] )
55+ readonly slicers = computed ( ( ) =>
56+ this . _slicers ( ) ?? this . data ( ) ?. slicers
57+ )
4958
5059 readonly primaryTheme = toSignal ( this . #store. primaryTheme$ )
5160
@@ -55,4 +64,8 @@ export class ChatComponentMessageComponent {
5564 theme : this . primaryTheme ( )
5665 }
5766 } )
67+
68+ updateSlicers ( slicers : ISlicer [ ] ) {
69+ this . _slicers . set ( slicers )
70+ }
5871}
0 commit comments