11import { casesI18n } from '@app-builder/components/Cases' ;
22import { AddRuleSnooze } from '@app-builder/components/Cases/AddRuleSnooze' ;
3- import { ClientObjectDataList } from '@app-builder/components/DataModelExplorer/ClientObjectDataList' ;
4- import { OutcomeBadge } from '@app-builder/components/Decisions' ;
53import { Nudge } from '@app-builder/components/Nudge' ;
64import { RuleGroup } from '@app-builder/components/Scenario/Rules/RuleGroup' ;
75import { ScoreModifier } from '@app-builder/components/Scenario/Rules/ScoreModifier' ;
@@ -18,6 +16,7 @@ import { Button, cn, Tabs, TabsContent, TabsList, TabsTrigger } from 'ui-design-
1816import { Icon } from 'ui-icons' ;
1917
2018import { DrawerContext } from '../Drawer/Drawer' ;
19+ import { PivotObjectDetails } from '../PivotsPanel/PivotsPanelContent' ;
2120
2221const findDataFromPivotValue = ( pivots : PivotObject [ ] , pivotValue : string ) => {
2322 return pivots . find ( ( p ) => p . pivotValue === pivotValue ) ;
@@ -60,28 +59,20 @@ export const SnoozePanel = ({
6059 < Tabs className = "flex w-full flex-col" defaultValue = { Object . keys ( rulesByPivot ) [ 0 ] } >
6160 < TabsList className = "mb-6 w-fit" >
6261 { Object . keys ( rulesByPivot ) . map ( ( pivotValue ) => {
63- const client = findDataFromPivotValue ( pivotObjects ?? [ ] , pivotValue ) ;
64-
65- const clientName =
66- client ?. pivotObjectData . data &&
67- 'name' in client . pivotObjectData . data &&
68- typeof client . pivotObjectData . data [ 'name' ] === 'string'
69- ? client . pivotObjectData . data [ 'name' ]
70- : pivotValue ;
71-
7262 return (
7363 < TabsTrigger
7464 key = { `trigger-${ pivotValue } ` }
7565 value = { pivotValue }
7666 className = "gap-2"
7767 >
78- < span className = "font-medium" > { clientName } </ span >
68+ < span className = "font-medium" > { pivotValue } </ span >
7969 </ TabsTrigger >
8070 ) ;
8171 } ) }
8272 </ TabsList >
8373 { Dict . entries ( rulesByPivot ) . map ( ( [ pivotValue , rules ] ) => {
8474 const client = findDataFromPivotValue ( pivotObjects ?? [ ] , pivotValue ) ;
75+ console . log ( 'client' , client ) ;
8576 const table = dataModelWithTableOptions . find (
8677 ( t ) => t . name === client ?. pivotObjectName ,
8778 ) ;
@@ -92,12 +83,15 @@ export const SnoozePanel = ({
9283 key = { `content-${ pivotValue } ` }
9384 value = { pivotValue }
9485 >
95- { table && client ?. pivotObjectData . data ? (
96- < ClientObjectDataList
97- className = "bg-grey-98 border-grey-95 rounded-sm border p-2"
98- tableModel = { table }
99- data = { client . pivotObjectData . data }
100- />
86+ { table && client ? (
87+ < div className = "border-grey-90 flex flex-col gap-v2-md border p-v2-md bg-grey-background-light rounded-v2-lg" >
88+ < div className = "capitalize font-semibold" > { table . name } </ div >
89+ < PivotObjectDetails
90+ tableModel = { table }
91+ dataModel = { dataModelWithTableOptions }
92+ pivotObject = { client }
93+ />
94+ </ div >
10195 ) : null }
10296 < div className = "border-grey-90 bg-grey-100 relative w-full rounded-lg border" >
10397 < div className = "text-2xs text-grey-50 relative grid grid-cols-[150px_120px_1fr_1fr_0.5fr_0.5fr_150px] font-normal" >
@@ -123,10 +117,10 @@ export const SnoozePanel = ({
123117 < span className = "p-2" > { t ( 'cases:decisions.rule.name_and_score' ) } </ span >
124118 < span className = "p-2" > { t ( 'cases:decisions.rule.description' ) } </ span >
125119 < span className = "p-2" > { t ( 'cases:decisions.rule.rule_group' ) } </ span >
126- < span className = "p-2" > { t ( 'cases:decisions.outcome' ) } </ span >
127120 < span className = "p-2" > { t ( 'cases:decisions.rule.snooze_until' ) } </ span >
128121 </ div >
129122 { rules . map ( ( r ) => {
123+ console . log ( r ) ;
130124 const formattedHitAt = (
131125 < span
132126 className = { cn ( 'text-grey-50 text-xs' , { 'opacity-30' : r . isSnoozed } ) }
@@ -195,12 +189,6 @@ export const SnoozePanel = ({
195189 />
196190 ) : null }
197191 </ div >
198- < div className = "border-grey-90 flex min-h-full items-center border-r p-2" >
199- < OutcomeBadge
200- className = { cn ( { 'opacity-30' : r . isSnoozed } ) }
201- outcome = { r . outcome }
202- />
203- </ div >
204192 < div className = "flex min-h-full items-center p-2" >
205193 { r . isSnoozed ? (
206194 < span className = "opacity-30" >
0 commit comments