33import { VoteRequest } from '@daml.js/splice-dso-governance/lib/Splice/DsoRules' ;
44import { ContractId } from '@daml/types' ;
55import { East } from '@mui/icons-material' ;
6- import { Alert , Box , Grid , Stack , Typography } from '@mui/material' ;
6+ import { Alert , Box , Stack , Typography } from '@mui/material' ;
77import { Link as RouterLink } from 'react-router' ;
88import { CopyableIdentifier , MemberIdentifier , PageSectionHeader } from '../../components/beta' ;
99import React from 'react' ;
@@ -55,6 +55,7 @@ export const ActionRequiredSection: React.FC<ActionRequiredProps> = (
5555 key = { index }
5656 action = { ar . actionName }
5757 description = { ar . description }
58+ createdAt = { ar . createdAt }
5859 contractId = { ar . contractId }
5960 votingEnds = { ar . votingCloses }
6061 requester = { ar . requester }
@@ -70,14 +71,15 @@ export const ActionRequiredSection: React.FC<ActionRequiredProps> = (
7071interface ActionCardProps {
7172 action : string ;
7273 description : string ;
74+ createdAt : string ;
7375 contractId : ContractId < VoteRequest > ;
7476 votingEnds : string ;
7577 requester : string ;
7678 isYou ?: boolean ;
7779}
7880
7981const ActionCard = ( props : ActionCardProps ) => {
80- const { action, description, contractId, votingEnds, requester, isYou } = props ;
82+ const { action, description, createdAt , contractId, votingEnds, requester, isYou } = props ;
8183 const remainingTime = dayjs ( votingEnds ) . fromNow ( true ) ;
8284
8385 return (
@@ -96,15 +98,15 @@ const ActionCard = (props: ActionCardProps) => {
9698 className = "action-required-card"
9799 data-testid = "action-required-card"
98100 >
99- < Grid flexGrow = { 1 } container spacing = { 1 } >
100- < Grid size = { 1.5 } >
101+ < Stack direction = "row" gap = { 5 } alignItems = "flex-start" >
102+ < Box sx = { { flexShrink : 0 } } >
101103 < ActionCardSegment
102104 title = "ACTION"
103105 content = { action }
104106 data-testid = "action-required-action"
105107 />
106- </ Grid >
107- < Grid size = { 2 } >
108+ </ Box >
109+ < Box sx = { { flexShrink : 1 , minWidth : 0 , maxWidth : 200 } } >
108110 < ActionCardSegment
109111 title = "DESCRIPTION"
110112 content = {
@@ -128,15 +130,22 @@ const ActionCard = (props: ActionCardProps) => {
128130 }
129131 data-testid = "action-required-description"
130132 />
131- </ Grid >
132- < Grid size = { 1.5 } >
133+ </ Box >
134+ < Box sx = { { flexShrink : 0 } } >
135+ < ActionCardSegment
136+ title = "CREATED AT"
137+ content = { createdAt }
138+ data-testid = "action-required-created-at"
139+ />
140+ </ Box >
141+ < Box sx = { { flexShrink : 0 } } >
133142 < ActionCardSegment
134143 title = "REMAINING TIME"
135144 content = { remainingTime }
136145 data-testid = "action-required-voting-closes"
137146 />
138- </ Grid >
139- < Grid size = { 2 } >
147+ </ Box >
148+ < Box sx = { { flexShrink : 1 , minWidth : 0 , maxWidth : 300 } } >
140149 < ActionCardSegment
141150 title = "REQUESTER"
142151 content = {
@@ -149,8 +158,8 @@ const ActionCard = (props: ActionCardProps) => {
149158 }
150159 data-testid = "action-required-requester"
151160 />
152- </ Grid >
153- < Grid size = { 2 } >
161+ </ Box >
162+ < Box sx = { { flexShrink : 1 , minWidth : 0 , maxWidth : 300 } } >
154163 < ActionCardSegment
155164 title = "CONTRACT ID"
156165 content = {
@@ -162,21 +171,20 @@ const ActionCard = (props: ActionCardProps) => {
162171 }
163172 data-testid = "action-required-contract-id-segment"
164173 />
165- </ Grid >
166- < Grid size = { 3 } display = "flex" justifyContent = "flex-end" alignItems = "center" >
167- < Stack
168- direction = "row"
169- alignItems = "center"
170- gap = { 1 }
171- data-testid = "action-required-view-details"
172- >
173- < Typography fontWeight = { 500 } color = "text.light" >
174- View Details
175- </ Typography >
176- < East fontSize = "small" color = "secondary" />
177- </ Stack >
178- </ Grid >
179- </ Grid >
174+ </ Box >
175+ < Stack
176+ direction = "row"
177+ alignItems = "center"
178+ gap = { 1 }
179+ sx = { { ml : 'auto' , flexShrink : 0 , alignSelf : 'center' } }
180+ data-testid = "action-required-view-details"
181+ >
182+ < Typography fontWeight = { 500 } color = "text.light" >
183+ View Details
184+ </ Typography >
185+ < East fontSize = "small" color = "secondary" />
186+ </ Stack >
187+ </ Stack >
180188 </ Box >
181189 </ RouterLink >
182190 ) ;
0 commit comments