11import SvgCircle from '@/features/common/components/svg/circle'
2+ import SvgPointerLeft from '@/features/common/components/svg/pointer-left'
3+ import SvgPointerRight from '@/features/common/components/svg/pointer-right'
24import { cn } from '@/features/common/utils'
35import { useMemo , useState } from 'react'
46
@@ -65,12 +67,16 @@ function TransactionTableRow({
6567 if ( index === foo . from )
6668 return (
6769 < td key = { index } colSpan = { foo . to - foo . from + 1 } >
68- < div className = { cn ( 'flex items-center justify-center bg-red-200 ' ) } >
70+ < div className = { cn ( 'flex items-center justify-center' ) } >
6971 < SvgCircle width = { 20 } height = { 20 } > </ SvgCircle >
7072 < div
71- className = { cn ( 'border-primary border-b-2' ) }
72- style = { { width : `calc(${ ( 100 - 100 / ( foo . to - foo . from + 1 ) ) . toFixed ( 2 ) } % - 20px)` } }
73- > </ div >
73+ style = { { width : `calc(${ ( 100 - 100 / ( foo . to - foo . from + 1 ) ) . toFixed ( 2 ) } % - 20px)` , height : '20px' } }
74+ className = "relative text-primary"
75+ >
76+ { foo . direction === 'rightToLeft' && < SvgPointerLeft className = { cn ( 'absolute top-0 left-0' ) } /> }
77+ < div className = { cn ( 'border-primary border-b-2 h-1/2' ) } > </ div >
78+ { foo . direction === 'leftToRight' && < SvgPointerRight className = { cn ( 'absolute top-0 right-0' ) } /> }
79+ </ div >
7480 < SvgCircle width = { 20 } height = { 20 } > </ SvgCircle >
7581 </ div >
7682 </ td >
@@ -123,7 +129,14 @@ export function GroupPage() {
123129 name : 'Inner 5' ,
124130 sender : 'Account 3' ,
125131 receiver : 'Account 1' ,
126- transactions : [ { name : 'Inner 10' , sender : 'Account 2' , receiver : 'Account 6' } ] ,
132+ transactions : [
133+ {
134+ name : 'Inner 10' ,
135+ sender : 'Account 2' ,
136+ receiver : 'Account 6' ,
137+ transactions : [ { name : 'Inner 12' , sender : 'Account 5' , receiver : 'Account 6' } ] ,
138+ } ,
139+ ] ,
127140 } ,
128141 ] ,
129142 } ,
@@ -147,21 +160,27 @@ export function GroupPage() {
147160 ] ,
148161 }
149162 const accounts = extractSendersAndReceivers ( group )
150- const allTransactionCounts = 15
163+ const allTransactionCounts = 16
164+
151165 return (
152- < table className = { cn ( '' ) } >
166+ < table className = { cn ( 'relative ' ) } >
153167 < tr >
154168 < th > </ th >
155169 { accounts . map ( ( account , index ) => (
156- < th className = { cn ( 'w-32 p-2' ) } key = { index } >
170+ < th className = { cn ( 'w-32 p-2 h-10 ' ) } key = { index } >
157171 { account }
158172 </ th >
159173 ) ) }
160174 </ tr >
161- < tbody style = { { height : ` ${ allTransactionCounts * 40 } px` } } >
175+ < tbody className = { cn ( 'absolute top-10 right-0 -z-10' ) } >
162176 < tr >
163177 < td className = { cn ( 'p-0' ) } > </ td >
164- < td className = { cn ( 'p-0' ) } rowSpan = { allTransactionCounts } colSpan = { accounts . length } >
178+ < td
179+ className = { cn ( 'p-0' ) }
180+ rowSpan = { allTransactionCounts }
181+ colSpan = { accounts . length }
182+ style = { { height : `${ allTransactionCounts * 40 } px` , width : `${ 128 * accounts . length } px` } }
183+ >
165184 < div
166185 className = { cn ( 'grid h-full' ) }
167186 style = { {
@@ -178,7 +197,7 @@ export function GroupPage() {
178197 </ td >
179198 </ tr >
180199 </ tbody >
181- < tbody className = "relative" style = { { top : `- ${ 15 * 40 } px` } } >
200+ < tbody >
182201 { group . transactions . map ( ( transaction , index , arr ) => (
183202 < TransactionTableRow
184203 transaction = { transaction }
0 commit comments