@xyo-network/react-chain-boundwitness 1.5.6 → 1.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.mjs +34 -107
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/components/transactions/card/Card.d.ts.map +1 -1
- package/package.json +8 -7
- package/src/components/transactions/card/Card.tsx +1 -3
- package/dist/types/components/transactions/card/DetailsStack.d.ts +0 -10
- package/dist/types/components/transactions/card/DetailsStack.d.ts.map +0 -1
- package/dist/types/components/transactions/card/LabelValueStack.d.ts +0 -8
- package/dist/types/components/transactions/card/LabelValueStack.d.ts.map +0 -1
- package/src/components/transactions/card/DetailsStack.tsx +0 -59
- package/src/components/transactions/card/LabelValueStack.tsx +0 -50
package/dist/browser/index.mjs
CHANGED
|
@@ -136,87 +136,14 @@ var BlockBoundWitnessDetails = /* @__PURE__ */ __name(({ block, paper, children,
|
|
|
136
136
|
}, "BlockBoundWitnessDetails");
|
|
137
137
|
|
|
138
138
|
// src/components/transactions/card/Card.tsx
|
|
139
|
-
import { Card, CardContent, Grid, Typography
|
|
139
|
+
import { Card, CardContent, Grid, Typography } from "@mui/material";
|
|
140
140
|
import { isUndefined } from "@xylabs/typeof";
|
|
141
141
|
import { bigIntToFixedPointString } from "@xyo-network/chain-utils";
|
|
142
|
-
import
|
|
142
|
+
import { DetailsStack, LabelValueStack } from "@xyo-network/react-chain-shared";
|
|
143
|
+
import React3, { useMemo as useMemo2 } from "react";
|
|
143
144
|
import { GiReceiveMoney, GiSandsOfTime } from "react-icons/gi";
|
|
144
145
|
import { IoStatsChartOutline } from "react-icons/io5";
|
|
145
146
|
import { MdOutlineAlternateEmail } from "react-icons/md";
|
|
146
|
-
|
|
147
|
-
// src/components/transactions/card/DetailsStack.tsx
|
|
148
|
-
import { Stack, styled, Tooltip, Typography, useTheme } from "@mui/material";
|
|
149
|
-
import { isDefined } from "@xylabs/typeof";
|
|
150
|
-
import React3, { useMemo as useMemo2 } from "react";
|
|
151
|
-
var DetailsStack = /* @__PURE__ */ __name(({ IconComponent, heading, children, tooltipTitle, ...props }) => {
|
|
152
|
-
const theme = useTheme();
|
|
153
|
-
const hasTooltip = isDefined(tooltipTitle);
|
|
154
|
-
const resolvedIconComponent = useMemo2(() => {
|
|
155
|
-
return IconComponent ? /* @__PURE__ */ React3.createElement(IconComponent, {
|
|
156
|
-
style: {
|
|
157
|
-
/** height and marginTop adjusted to account for font not filling container with line-height: 1 */
|
|
158
|
-
height: "0.85rem",
|
|
159
|
-
marginTop: 0.5,
|
|
160
|
-
marginLeft: theme.spacing(1)
|
|
161
|
-
}
|
|
162
|
-
}) : /* @__PURE__ */ React3.createElement(React3.Fragment, null);
|
|
163
|
-
}, [
|
|
164
|
-
IconComponent
|
|
165
|
-
]);
|
|
166
|
-
return /* @__PURE__ */ React3.createElement(Stack, {
|
|
167
|
-
direction: "column",
|
|
168
|
-
flexGrow: 1,
|
|
169
|
-
flexWrap: "wrap",
|
|
170
|
-
minWidth: "1px",
|
|
171
|
-
...props
|
|
172
|
-
}, /* @__PURE__ */ React3.createElement(SectionHeadingTypography, null, heading, hasTooltip ? /* @__PURE__ */ React3.createElement(Tooltip, {
|
|
173
|
-
title: tooltipTitle
|
|
174
|
-
}, resolvedIconComponent) : resolvedIconComponent), children);
|
|
175
|
-
}, "DetailsStack");
|
|
176
|
-
var SectionHeadingTypography = styled(Typography, {
|
|
177
|
-
name: "SectionHeadingTypography"
|
|
178
|
-
})(({ theme }) => ({
|
|
179
|
-
display: "flex",
|
|
180
|
-
fontFamily: "monospace",
|
|
181
|
-
lineHeight: 1,
|
|
182
|
-
marginBottom: theme.spacing(1.5)
|
|
183
|
-
}));
|
|
184
|
-
|
|
185
|
-
// src/components/transactions/card/LabelValueStack.tsx
|
|
186
|
-
import { Stack as Stack2, Typography as Typography2, useTheme as useTheme2 } from "@mui/material";
|
|
187
|
-
import React4 from "react";
|
|
188
|
-
var LabelValueStack = /* @__PURE__ */ __name(({ labels, values, ...props }) => {
|
|
189
|
-
const theme = useTheme2();
|
|
190
|
-
return /* @__PURE__ */ React4.createElement(Stack2, {
|
|
191
|
-
flexDirection: "row",
|
|
192
|
-
flexGrow: 1,
|
|
193
|
-
...props
|
|
194
|
-
}, /* @__PURE__ */ React4.createElement(Stack2, null, labels.map((label) => /* @__PURE__ */ React4.createElement(Typography2, {
|
|
195
|
-
fontWeight: "300",
|
|
196
|
-
key: label,
|
|
197
|
-
variant: "body2",
|
|
198
|
-
sx: {
|
|
199
|
-
borderBottom: `1px solid ${theme.vars?.palette.divider}`,
|
|
200
|
-
opacity: 0.7
|
|
201
|
-
}
|
|
202
|
-
}, label, ":"))), /* @__PURE__ */ React4.createElement(Stack2, {
|
|
203
|
-
alignItems: "end",
|
|
204
|
-
flexGrow: 1
|
|
205
|
-
}, values.map((value, index) => /* @__PURE__ */ React4.createElement(Typography2, {
|
|
206
|
-
fontFamily: "monospace",
|
|
207
|
-
variant: "body2",
|
|
208
|
-
// Use matching label as key since values might be the same
|
|
209
|
-
key: labels[index],
|
|
210
|
-
width: "100%",
|
|
211
|
-
sx: {
|
|
212
|
-
display: "flex",
|
|
213
|
-
justifyContent: "end",
|
|
214
|
-
borderBottom: `1px solid ${theme.vars?.palette.divider}`
|
|
215
|
-
}
|
|
216
|
-
}, value))));
|
|
217
|
-
}, "LabelValueStack");
|
|
218
|
-
|
|
219
|
-
// src/components/transactions/card/Card.tsx
|
|
220
147
|
var formatFee = /* @__PURE__ */ __name((fee) => {
|
|
221
148
|
if (isUndefined(fee)) return;
|
|
222
149
|
const stringValue = bigIntToFixedPointString(fee, 12);
|
|
@@ -225,7 +152,7 @@ var formatFee = /* @__PURE__ */ __name((fee) => {
|
|
|
225
152
|
}, "formatFee");
|
|
226
153
|
var TransactionBoundWitnessCard = /* @__PURE__ */ __name(({ wrapper, ...props }) => {
|
|
227
154
|
if (!wrapper) return null;
|
|
228
|
-
const stats =
|
|
155
|
+
const stats = useMemo2(() => {
|
|
229
156
|
const labels = [
|
|
230
157
|
"Reward",
|
|
231
158
|
"Elevated Payloads",
|
|
@@ -246,7 +173,7 @@ var TransactionBoundWitnessCard = /* @__PURE__ */ __name(({ wrapper, ...props })
|
|
|
246
173
|
}, [
|
|
247
174
|
wrapper
|
|
248
175
|
]);
|
|
249
|
-
const fees =
|
|
176
|
+
const fees = useMemo2(() => {
|
|
250
177
|
const labels = [
|
|
251
178
|
"Base",
|
|
252
179
|
"Gas",
|
|
@@ -266,7 +193,7 @@ var TransactionBoundWitnessCard = /* @__PURE__ */ __name(({ wrapper, ...props })
|
|
|
266
193
|
}, [
|
|
267
194
|
wrapper
|
|
268
195
|
]);
|
|
269
|
-
const blockDuration =
|
|
196
|
+
const blockDuration = useMemo2(() => {
|
|
270
197
|
const labels = [
|
|
271
198
|
"Expiration",
|
|
272
199
|
"Not Before"
|
|
@@ -282,21 +209,21 @@ var TransactionBoundWitnessCard = /* @__PURE__ */ __name(({ wrapper, ...props })
|
|
|
282
209
|
}, [
|
|
283
210
|
wrapper
|
|
284
211
|
]);
|
|
285
|
-
return /* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ React3.createElement(Card, props, /* @__PURE__ */ React3.createElement(CardContent, null, /* @__PURE__ */ React3.createElement(Grid, {
|
|
286
213
|
container: true,
|
|
287
214
|
spacing: 6,
|
|
288
215
|
sx: {
|
|
289
216
|
width: "100%"
|
|
290
217
|
}
|
|
291
|
-
}, /* @__PURE__ */
|
|
218
|
+
}, /* @__PURE__ */ React3.createElement(Grid, {
|
|
292
219
|
size: {
|
|
293
220
|
xs: 12
|
|
294
221
|
}
|
|
295
|
-
}, /* @__PURE__ */
|
|
222
|
+
}, /* @__PURE__ */ React3.createElement(DetailsStack, {
|
|
296
223
|
IconComponent: MdOutlineAlternateEmail,
|
|
297
224
|
heading: "From:",
|
|
298
225
|
tooltipTitle: "Address of the sender"
|
|
299
|
-
}, /* @__PURE__ */
|
|
226
|
+
}, /* @__PURE__ */ React3.createElement(Typography, {
|
|
300
227
|
variant: "body2",
|
|
301
228
|
sx: {
|
|
302
229
|
maxWidth: "100%",
|
|
@@ -304,43 +231,43 @@ var TransactionBoundWitnessCard = /* @__PURE__ */ __name(({ wrapper, ...props })
|
|
|
304
231
|
overflow: "hidden",
|
|
305
232
|
fontFamily: "monospace"
|
|
306
233
|
}
|
|
307
|
-
}, wrapper?.boundWitness.from))), /* @__PURE__ */
|
|
234
|
+
}, wrapper?.boundWitness.from))), /* @__PURE__ */ React3.createElement(Grid, {
|
|
308
235
|
size: {
|
|
309
236
|
xs: 12,
|
|
310
237
|
sm: 6,
|
|
311
238
|
md: 4
|
|
312
239
|
}
|
|
313
|
-
}, /* @__PURE__ */
|
|
240
|
+
}, /* @__PURE__ */ React3.createElement(DetailsStack, {
|
|
314
241
|
IconComponent: IoStatsChartOutline,
|
|
315
242
|
heading: "Stats",
|
|
316
243
|
tooltipTitle: "Transaction Statistics"
|
|
317
|
-
}, /* @__PURE__ */
|
|
244
|
+
}, /* @__PURE__ */ React3.createElement(LabelValueStack, {
|
|
318
245
|
labels: stats.labels,
|
|
319
246
|
values: stats.values
|
|
320
|
-
}))), /* @__PURE__ */
|
|
247
|
+
}))), /* @__PURE__ */ React3.createElement(Grid, {
|
|
321
248
|
size: {
|
|
322
249
|
xs: 12,
|
|
323
250
|
sm: 6,
|
|
324
251
|
md: 4
|
|
325
252
|
}
|
|
326
|
-
}, /* @__PURE__ */
|
|
253
|
+
}, /* @__PURE__ */ React3.createElement(DetailsStack, {
|
|
327
254
|
IconComponent: GiReceiveMoney,
|
|
328
255
|
heading: "Fees",
|
|
329
256
|
tooltipTitle: "Fees offered to the producer"
|
|
330
|
-
}, /* @__PURE__ */
|
|
257
|
+
}, /* @__PURE__ */ React3.createElement(LabelValueStack, {
|
|
331
258
|
labels: fees.labels,
|
|
332
259
|
values: fees.values
|
|
333
|
-
}))), /* @__PURE__ */
|
|
260
|
+
}))), /* @__PURE__ */ React3.createElement(Grid, {
|
|
334
261
|
size: {
|
|
335
262
|
xs: 12,
|
|
336
263
|
sm: 6,
|
|
337
264
|
md: 4
|
|
338
265
|
}
|
|
339
|
-
}, /* @__PURE__ */
|
|
266
|
+
}, /* @__PURE__ */ React3.createElement(DetailsStack, {
|
|
340
267
|
IconComponent: GiSandsOfTime,
|
|
341
268
|
heading: "Block Duration",
|
|
342
269
|
tooltipTitle: "Block window for the transaction to be valid"
|
|
343
|
-
}, /* @__PURE__ */
|
|
270
|
+
}, /* @__PURE__ */ React3.createElement(LabelValueStack, {
|
|
344
271
|
labels: blockDuration.labels,
|
|
345
272
|
values: blockDuration.values
|
|
346
273
|
}))))));
|
|
@@ -350,11 +277,11 @@ var TransactionBoundWitnessCard = /* @__PURE__ */ __name(({ wrapper, ...props })
|
|
|
350
277
|
import { ErrorRender as ErrorRender2 } from "@xylabs/react-error";
|
|
351
278
|
import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
|
|
352
279
|
import { usePromise as usePromise2 } from "@xylabs/react-promise";
|
|
353
|
-
import { isDefined
|
|
280
|
+
import { isDefined } from "@xylabs/typeof";
|
|
354
281
|
import { SignedHydratedTransactionWrapper } from "@xyo-network/chain-wrappers";
|
|
355
282
|
import { PayloadBuilder as PayloadBuilder2 } from "@xyo-network/payload-builder";
|
|
356
283
|
import { BoundWitnessSignatureTable as BoundWitnessSignatureTable2, BWActions as BWActions2, HashHeadingPaper as HashHeadingPaper2, HeadingPaper as HeadingPaper3 } from "@xyo-network/react-boundwitness-plugin";
|
|
357
|
-
import
|
|
284
|
+
import React4 from "react";
|
|
358
285
|
import { FaSignature as FaSignature2 } from "react-icons/fa";
|
|
359
286
|
import { VscSymbolMethod as VscSymbolMethod3 } from "react-icons/vsc";
|
|
360
287
|
var TransactionBoundWitnessDetails = /* @__PURE__ */ __name(({ transaction, ...props }) => {
|
|
@@ -366,7 +293,7 @@ var TransactionBoundWitnessDetails = /* @__PURE__ */ __name(({ transaction, ...p
|
|
|
366
293
|
transaction
|
|
367
294
|
]);
|
|
368
295
|
const [elevatedPayloadSets, elevatedPayloadSetsError] = usePromise2(async () => {
|
|
369
|
-
if (
|
|
296
|
+
if (isDefined(wrapper)) {
|
|
370
297
|
const elevatedPayloads = wrapper.elevatedPayloads;
|
|
371
298
|
const pairs = await PayloadBuilder2.hashPairs(elevatedPayloads);
|
|
372
299
|
return formatPayloadsForTable(pairs);
|
|
@@ -380,49 +307,49 @@ var TransactionBoundWitnessDetails = /* @__PURE__ */ __name(({ transaction, ...p
|
|
|
380
307
|
wrapper
|
|
381
308
|
]);
|
|
382
309
|
const { hashes: elevatedPayloadHashes, schemas: elevatedPayloadSchemas } = elevatedPayloadSets ?? {};
|
|
383
|
-
return /* @__PURE__ */
|
|
310
|
+
return /* @__PURE__ */ React4.createElement(FlexCol3, {
|
|
384
311
|
alignItems: "stretch",
|
|
385
312
|
rowGap: 2,
|
|
386
313
|
...props
|
|
387
|
-
}, /* @__PURE__ */
|
|
314
|
+
}, /* @__PURE__ */ React4.createElement(HashHeadingPaper2, {
|
|
388
315
|
hash: wrapper?.boundWitness?._hash,
|
|
389
316
|
paperProps: {
|
|
390
317
|
sx: {
|
|
391
318
|
p: 2
|
|
392
319
|
}
|
|
393
320
|
},
|
|
394
|
-
AdornmentEnd: /* @__PURE__ */
|
|
321
|
+
AdornmentEnd: /* @__PURE__ */ React4.createElement(BWActions2, {
|
|
395
322
|
boundwitness: wrapper?.boundWitness
|
|
396
323
|
}),
|
|
397
324
|
identiconProps: {
|
|
398
325
|
p: 0.75,
|
|
399
326
|
size: 24
|
|
400
327
|
}
|
|
401
|
-
}), /* @__PURE__ */
|
|
328
|
+
}), /* @__PURE__ */ React4.createElement(ErrorRender2, {
|
|
402
329
|
error: wrapperError,
|
|
403
330
|
scope: "wrapperError:TransactionBoundWitnessDetails.tsx"
|
|
404
|
-
}), /* @__PURE__ */
|
|
331
|
+
}), /* @__PURE__ */ React4.createElement(ErrorRender2, {
|
|
405
332
|
error: elevatedPayloadSetsError,
|
|
406
333
|
scope: "elevatedPayloadSetsError:TransactionBoundWitnessDetails.tsx"
|
|
407
|
-
}), /* @__PURE__ */
|
|
334
|
+
}), /* @__PURE__ */ React4.createElement(TransactionBoundWitnessCard, {
|
|
408
335
|
elevation: 4,
|
|
409
336
|
wrapper
|
|
410
|
-
}), /* @__PURE__ */
|
|
411
|
-
IconComponent: /* @__PURE__ */
|
|
337
|
+
}), /* @__PURE__ */ React4.createElement(BWPayloadTableFlexbox, {
|
|
338
|
+
IconComponent: /* @__PURE__ */ React4.createElement(VscSymbolMethod3, null),
|
|
412
339
|
hashes: elevatedPayloadHashes,
|
|
413
340
|
headingTitle: "Elevated Payloads",
|
|
414
341
|
schemas: elevatedPayloadSchemas,
|
|
415
342
|
sx: {
|
|
416
343
|
mb: 1
|
|
417
344
|
}
|
|
418
|
-
}), /* @__PURE__ */
|
|
345
|
+
}), /* @__PURE__ */ React4.createElement(FlexCol3, {
|
|
419
346
|
alignItems: "stretch",
|
|
420
347
|
rowGap: 1,
|
|
421
348
|
mb: 1
|
|
422
|
-
}, /* @__PURE__ */
|
|
423
|
-
IconComponent: /* @__PURE__ */
|
|
349
|
+
}, /* @__PURE__ */ React4.createElement(HeadingPaper3, {
|
|
350
|
+
IconComponent: /* @__PURE__ */ React4.createElement(FaSignature2, null),
|
|
424
351
|
heading: "Signatures"
|
|
425
|
-
}), /* @__PURE__ */
|
|
352
|
+
}), /* @__PURE__ */ React4.createElement(BoundWitnessSignatureTable2, {
|
|
426
353
|
block: wrapper?.boundWitness
|
|
427
354
|
})));
|
|
428
355
|
}, "TransactionBoundWitnessDetails");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/block/BlockBoundWitnessDetails.tsx","../../src/lib/formatPayloadsForTable.ts","../../src/components/BwPayloadTable.tsx","../../src/components/transactions/card/Card.tsx","../../src/components/transactions/card/DetailsStack.tsx","../../src/components/transactions/card/LabelValueStack.tsx","../../src/components/transactions/TransactionDetails.tsx"],"sourcesContent":["import { Divider } from '@mui/material'\nimport { filterAs } from '@xylabs/array'\nimport { ErrorRender } from '@xylabs/react-error'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { usePromise } from '@xylabs/react-promise'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport {\n BoundWitnessPayloadsTable,\n BoundWitnessSignatureTable,\n BWActions,\n HashHeadingPaper,\n HeadingPaper,\n} from '@xyo-network/react-boundwitness-plugin'\nimport { useTxsFromBlock } from '@xyo-network/react-chain-blockchain'\nimport { usePayloadHash } from '@xyo-network/react-shared'\nimport { isTransactionBoundWitness, type SignedHydratedBlock } from '@xyo-network/xl1-protocol'\nimport React, { useMemo } from 'react'\nimport { FaSignature } from 'react-icons/fa'\nimport { GrTransaction } from 'react-icons/gr'\nimport { VscSymbolMethod, VscSymbolNamespace } from 'react-icons/vsc'\n\nimport { formatPayloadsForTable } from '../../lib/index.ts'\nimport type { TransactionBoundWitnessEvents } from '../../types/index.ts'\nimport { BWPayloadTableFlexbox } from '../BwPayloadTable.tsx'\n\nexport interface BoundWitnessDetailsProps extends FlexBoxProps {\n block?: SignedHydratedBlock\n}\n\nexport const BlockBoundWitnessDetails = ({\n block, paper, children, ...props\n}: BoundWitnessDetailsProps) => {\n const boundWitness = block?.[0]\n const payloads = block?.[1]\n\n const hash = usePayloadHash(boundWitness)\n\n const [transactions, txFromBlockError] = useTxsFromBlock(block)\n\n const { hashes: txHashes, schemas: txSchemas } = useMemo(() => formatPayloadsForTable(transactions ?? []), [transactions])\n\n const [nonTxBoundWitnesses, bwsFromBlockError] = usePromise(async () => {\n const bws = filterAs(payloads ?? [], payload =>\n (!isTransactionBoundWitness(payload) && isBoundWitness(payload)) ? payload : undefined)\n return await PayloadBuilder.hashPairs(bws)\n }, [payloads])\n\n const { hashes: nonTxBwHashes, schemas: nonTxBwSchemas } = useMemo(() => formatPayloadsForTable(nonTxBoundWitnesses ?? []), [nonTxBoundWitnesses])\n const hasNonTxBoundWitnesses = (nonTxBoundWitnesses?.length ?? 0) > 0\n\n return (\n <FlexCol alignItems=\"stretch\" rowGap={4} {...props}>\n <ErrorRender error={txFromBlockError ?? bwsFromBlockError} scope=\"BlockBoundWitnessDetails.tsx\" />\n <HashHeadingPaper\n hash={hash}\n paperProps={{ sx: { p: 2 } }}\n AdornmentEnd={<BWActions boundwitness={boundWitness} />}\n identiconProps={{ p: 0.75, size: 24 }}\n />\n <Divider flexItem />\n {(transactions?.length ?? 0) > 0 && (\n <BWPayloadTableFlexbox<TransactionBoundWitnessEvents>\n IconComponent={<GrTransaction />}\n eventNoun=\"transaction\"\n hashes={txHashes}\n headingTitle=\"Transactions\"\n schemas={txSchemas}\n sx={{ mb: 1 }}\n />\n )}\n <FlexCol alignItems=\"stretch\" rowGap={1} mb={1}>\n <HeadingPaper IconComponent={<VscSymbolNamespace />} heading=\"Payloads\" />\n <BoundWitnessPayloadsTable boundwitness={boundWitness} />\n </FlexCol>\n {hasNonTxBoundWitnesses\n ? (\n <BWPayloadTableFlexbox<TransactionBoundWitnessEvents>\n IconComponent={<VscSymbolMethod />}\n eventNoun=\"boundwitness\"\n hashes={nonTxBwHashes}\n headingTitle=\"Bound Witnesses\"\n schemas={nonTxBwSchemas}\n sx={{ mb: 1 }}\n />\n )\n : null}\n <FlexCol alignItems=\"stretch\" rowGap={1} mb={1}>\n <HeadingPaper IconComponent={<FaSignature />} heading=\"Signatures\" />\n <BoundWitnessSignatureTable block={boundWitness} />\n </FlexCol>\n </FlexCol>\n )\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport const formatPayloadsForTable = (pairs: [Payload, Hash][]) => {\n let hashes: Hash[] = []\n let schemas: string[] = []\n for (const [bw, hash] of pairs ?? []) {\n hashes.push(hash)\n schemas.push(bw?.schema ?? '')\n }\n return { hashes, schemas }\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport {\n BoundWitnessPayloadTableBody, BoundWitnessPayloadTableHead, HeadingPaper,\n} from '@xyo-network/react-boundwitness-plugin'\nimport type { EventNoun, ExtendEventNoun } from '@xyo-network/react-event'\nimport { TableEx } from '@xyo-network/react-table'\nimport React from 'react'\nimport { VscSymbolMethod } from 'react-icons/vsc'\n\nexport interface BWPayloadTableFlexboxProps<TNoun extends ExtendEventNoun = EventNoun> extends FlexBoxProps {\n IconComponent?: React.ReactNode\n eventNoun?: TNoun\n hashes?: Hash[]\n headingTitle?: string\n schemas?: string[]\n}\n\nexport const BWPayloadTableFlexbox = <TNoun extends ExtendEventNoun = EventNoun>({\n IconComponent,\n eventNoun,\n hashes,\n schemas,\n headingTitle,\n ...props\n}: BWPayloadTableFlexboxProps<TNoun>) => {\n const resolvedIconComponent = IconComponent ?? <VscSymbolMethod />\n return (\n <FlexCol alignItems=\"stretch\" rowGap={1} {...props}>\n <HeadingPaper IconComponent={resolvedIconComponent} heading={headingTitle} />\n <TableEx>\n <BoundWitnessPayloadTableHead />\n <BoundWitnessPayloadTableBody<TNoun> payloadHashes={hashes} payloadSchemas={schemas} eventNoun={eventNoun} />\n </TableEx>\n </FlexCol>\n )\n}\n","import type { CardProps } from '@mui/material'\nimport {\n Card, CardContent, Grid, Typography,\n} from '@mui/material'\nimport { isUndefined } from '@xylabs/typeof'\nimport { bigIntToFixedPointString } from '@xyo-network/chain-utils'\nimport type { SignedHydratedTransactionInstance } from '@xyo-network/xl1-protocol-sdk'\nimport React, { useMemo } from 'react'\nimport { GiReceiveMoney, GiSandsOfTime } from 'react-icons/gi'\nimport { IoStatsChartOutline } from 'react-icons/io5'\nimport { MdOutlineAlternateEmail } from 'react-icons/md'\n\nimport { DetailsStack } from './DetailsStack.tsx'\nimport { LabelValueStack } from './LabelValueStack.tsx'\n\nconst formatFee = (fee?: bigint) => {\n if (isUndefined(fee)) return\n const stringValue = bigIntToFixedPointString(fee, 12)\n if (stringValue === '0') return '0.0'\n return stringValue\n}\n\nexport interface TransactionBoundWitnessCardProps extends CardProps {\n wrapper?: SignedHydratedTransactionInstance\n}\n\nexport const TransactionBoundWitnessCard: React.FC<TransactionBoundWitnessCardProps> = ({ wrapper, ...props }) => {\n if (!wrapper) return null\n\n const stats = useMemo(() => {\n const labels = [\n 'Reward',\n 'Elevated Payloads',\n 'Total Payloads',\n 'Signatures',\n ]\n\n const values: (string | undefined)[] = [\n wrapper.reward().toLocaleString(navigator.language ?? 'en-US'),\n wrapper.elevatedPayloadCount.toLocaleString(navigator.language ?? 'en-US'),\n wrapper.payloadCount.toLocaleString(navigator.language ?? 'en-US'),\n wrapper.signatureCount.toLocaleString(navigator.language ?? 'en-US'),,\n ]\n\n return { labels, values } as const\n }, [wrapper])\n\n const fees = useMemo(() => {\n const labels = [\n 'Base',\n 'Gas',\n 'Priority',\n 'Gas Limit',\n ]\n const values = [\n formatFee(wrapper.fees.base),\n formatFee(wrapper.fees.gasPrice),\n formatFee(wrapper.fees.priority),\n formatFee(wrapper.fees.gasLimit),\n ]\n\n return { labels, values } as const\n }, [wrapper])\n\n const blockDuration = useMemo(() => {\n const labels = [\n 'Expiration',\n 'Not Before',\n ]\n\n const values = [\n wrapper.boundWitness.exp.toLocaleString(navigator.language ?? 'en-US'),\n wrapper.boundWitness.nbf.toLocaleString(navigator.language ?? 'en-US'),\n ]\n\n return { labels, values } as const\n }, [wrapper])\n\n return (\n <Card {...props}>\n <CardContent>\n <Grid container spacing={6} sx={{ width: '100%' }}>\n <Grid size={{ xs: 12 }}>\n <DetailsStack IconComponent={MdOutlineAlternateEmail} heading=\"From:\" tooltipTitle=\"Address of the sender\">\n <Typography\n variant=\"body2\"\n sx={{\n maxWidth: '100%', textOverflow: 'ellipsis', overflow: 'hidden', fontFamily: 'monospace',\n }}\n >\n {wrapper?.boundWitness.from}\n </Typography>\n </DetailsStack>\n </Grid>\n <Grid size={{\n xs: 12, sm: 6, md: 4,\n }}\n >\n <DetailsStack IconComponent={IoStatsChartOutline} heading=\"Stats\" tooltipTitle=\"Transaction Statistics\">\n <LabelValueStack labels={stats.labels} values={stats.values} />\n </DetailsStack>\n </Grid>\n <Grid size={{\n xs: 12, sm: 6, md: 4,\n }}\n >\n <DetailsStack IconComponent={GiReceiveMoney} heading=\"Fees\" tooltipTitle=\"Fees offered to the producer\">\n <LabelValueStack labels={fees.labels} values={fees.values} />\n </DetailsStack>\n </Grid>\n <Grid size={{\n xs: 12, sm: 6, md: 4,\n }}\n >\n <DetailsStack IconComponent={GiSandsOfTime} heading=\"Block Duration\" tooltipTitle=\"Block window for the transaction to be valid\">\n <LabelValueStack labels={blockDuration.labels} values={blockDuration.values} />\n </DetailsStack>\n </Grid>\n </Grid>\n </CardContent>\n </Card>\n )\n}\n","import type { StackProps } from '@mui/material'\nimport {\n Stack, styled, Tooltip, Typography,\n useTheme,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/typeof'\nimport type { ComponentType, SVGAttributes } from 'react'\nimport React, { useMemo } from 'react'\n\nexport interface DetailsStackProps extends StackProps {\n IconComponent?: ComponentType<SVGAttributes<SVGElement>>\n heading?: string\n tooltipTitle?: string\n}\n\nexport const DetailsStack: React.FC<DetailsStackProps> = ({\n IconComponent, heading, children, tooltipTitle, ...props\n}) => {\n const theme = useTheme()\n\n const hasTooltip = isDefined(tooltipTitle)\n const resolvedIconComponent = useMemo(() => {\n return IconComponent\n ? (\n <IconComponent\n style={{\n /** height and marginTop adjusted to account for font not filling container with line-height: 1 */\n height: '0.85rem',\n marginTop: 0.5,\n marginLeft: theme.spacing(1),\n }}\n />\n )\n : <></>\n }, [IconComponent])\n\n return (\n <Stack direction=\"column\" flexGrow={1} flexWrap=\"wrap\" minWidth=\"1px\" {...props}>\n <SectionHeadingTypography>\n {heading}\n {hasTooltip\n ? (\n <Tooltip title={tooltipTitle}>\n {resolvedIconComponent}\n </Tooltip>\n )\n : resolvedIconComponent}\n </SectionHeadingTypography>\n {children}\n </Stack>\n )\n}\n\nconst SectionHeadingTypography = styled(Typography, { name: 'SectionHeadingTypography' })(({ theme }) => ({\n display: 'flex',\n fontFamily: 'monospace',\n lineHeight: 1,\n marginBottom: theme.spacing(1.5),\n}))\n","import type { StackProps } from '@mui/material'\nimport {\n Stack, Typography, useTheme,\n} from '@mui/material'\nimport React from 'react'\n\nexport interface LabelValueStackProps extends StackProps {\n labels: string[]\n values: (string | undefined)[]\n}\n\nexport const LabelValueStack: React.FC<LabelValueStackProps> = ({\n labels, values, ...props\n}) => {\n const theme = useTheme()\n\n return (\n <Stack flexDirection=\"row\" flexGrow={1} {...props}>\n <Stack>\n {labels.map(label => (\n <Typography\n fontWeight=\"300\"\n key={label}\n variant=\"body2\"\n sx={{ borderBottom: `1px solid ${theme.vars?.palette.divider}`, opacity: 0.7 }}\n >\n {label}\n :\n </Typography>\n ))}\n </Stack>\n <Stack alignItems=\"end\" flexGrow={1}>\n {values.map((value, index) => (\n <Typography\n fontFamily=\"monospace\"\n variant=\"body2\"\n // Use matching label as key since values might be the same\n key={labels[index]}\n width=\"100%\"\n sx={{\n display: 'flex', justifyContent: 'end', borderBottom: `1px solid ${theme.vars?.palette.divider}`,\n }}\n >\n {value}\n </Typography>\n ))}\n </Stack>\n </Stack>\n )\n}\n","import { ErrorRender } from '@xylabs/react-error'\nimport { type FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\nimport { usePromise } from '@xylabs/react-promise'\nimport { isDefined } from '@xylabs/typeof'\nimport { SignedHydratedTransactionWrapper } from '@xyo-network/chain-wrappers'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport {\n BoundWitnessSignatureTable, BWActions, HashHeadingPaper, HeadingPaper,\n} from '@xyo-network/react-boundwitness-plugin'\nimport type { SignedHydratedTransaction } from '@xyo-network/xl1-protocol'\nimport React from 'react'\nimport { FaSignature } from 'react-icons/fa'\nimport { VscSymbolMethod } from 'react-icons/vsc'\n\nimport { formatPayloadsForTable } from '../../lib/index.ts'\nimport { BWPayloadTableFlexbox } from '../BwPayloadTable.tsx'\nimport { TransactionBoundWitnessCard } from './card/index.ts'\n\nexport interface TransactionBoundWitnessDetailsProps extends FlexBoxProps {\n transaction?: SignedHydratedTransaction | null\n}\n\nexport const TransactionBoundWitnessDetails: React.FC<TransactionBoundWitnessDetailsProps> = ({ transaction, ...props }) => {\n const [wrapper, wrapperError] = usePromise(async () => {\n if (transaction) {\n return await SignedHydratedTransactionWrapper.parse(transaction)\n }\n }, [transaction])\n\n const [elevatedPayloadSets, elevatedPayloadSetsError] = usePromise(async () => {\n if (isDefined(wrapper)) {\n const elevatedPayloads = wrapper.elevatedPayloads\n const pairs = await PayloadBuilder.hashPairs(elevatedPayloads)\n return formatPayloadsForTable(pairs)\n } else {\n return { hashes: [], schemas: [] }\n }\n }, [wrapper])\n\n const { hashes: elevatedPayloadHashes, schemas: elevatedPayloadSchemas } = elevatedPayloadSets ?? {}\n\n return (\n <FlexCol alignItems=\"stretch\" rowGap={2} {...props}>\n <HashHeadingPaper\n hash={wrapper?.boundWitness?._hash}\n paperProps={{ sx: { p: 2 } }}\n AdornmentEnd={<BWActions boundwitness={wrapper?.boundWitness} />}\n identiconProps={{ p: 0.75, size: 24 }}\n />\n <ErrorRender error={wrapperError} scope=\"wrapperError:TransactionBoundWitnessDetails.tsx\" />\n <ErrorRender error={elevatedPayloadSetsError} scope=\"elevatedPayloadSetsError:TransactionBoundWitnessDetails.tsx\" />\n <TransactionBoundWitnessCard elevation={4} wrapper={wrapper} />\n <BWPayloadTableFlexbox\n IconComponent={<VscSymbolMethod />}\n hashes={elevatedPayloadHashes}\n headingTitle=\"Elevated Payloads\"\n schemas={elevatedPayloadSchemas}\n sx={{ mb: 1 }}\n />\n <FlexCol alignItems=\"stretch\" rowGap={1} mb={1}>\n <HeadingPaper IconComponent={<FaSignature />} heading=\"Signatures\" />\n <BoundWitnessSignatureTable block={wrapper?.boundWitness} />\n </FlexCol>\n </FlexCol>\n )\n}\n"],"mappings":";;;;AAA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IAAQC,YAAW;IAAUC,QAAQ;IAAI,GAAGrB;KAC3C,gBAAAkB,OAAA,cAACI,mBAAAA;IACCC,MAAMtB,SAASuB,cAAcC;IAC7BC,YAAY;MAAEC,IAAI;QAAEC,GAAG;MAAE;IAAE;IAC3BC,cAAc,gBAAAX,OAAA,cAACY,YAAAA;MAAUC,cAAc9B,SAASuB;;IAChDQ,gBAAgB;MAAEJ,GAAG;MAAMK,MAAM;IAAG;MAEtC,gBAAAf,OAAA,cAACgB,cAAAA;IAAYC,OAAOjC;IAAckC,OAAM;MACxC,gBAAAlB,OAAA,cAACgB,cAAAA;IAAYC,OAAO5B;IAA0B6B,OAAM;MACpD,gBAAAlB,OAAA,cAACmB,6BAAAA;IAA4BC,WAAW;IAAGrC;MAC3C,gBAAAiB,OAAA,cAACqB,uBAAAA;IACCC,eAAe,gBAAAtB,OAAA,cAACuB,kBAAAA,IAAAA;IAChB3B,QAAQE;IACR0B,cAAa;IACb3B,SAASE;IACTU,IAAI;MAAEgB,IAAI;IAAE;MAEd,gBAAAzB,OAAA,cAACC,UAAAA;IAAQC,YAAW;IAAUC,QAAQ;IAAGsB,IAAI;KAC3C,gBAAAzB,OAAA,cAAC0B,eAAAA;IAAaJ,eAAe,gBAAAtB,OAAA,cAAC2B,cAAAA,IAAAA;IAAgBC,SAAQ;MACtD,gBAAA5B,OAAA,cAAC6B,6BAAAA;IAA2BC,OAAO/C,SAASuB;;AAIpD,GA3C6F;","names":["Divider","filterAs","ErrorRender","FlexCol","usePromise","isBoundWitness","PayloadBuilder","BoundWitnessPayloadsTable","BoundWitnessSignatureTable","BWActions","HashHeadingPaper","HeadingPaper","useTxsFromBlock","usePayloadHash","isTransactionBoundWitness","React","useMemo","FaSignature","GrTransaction","VscSymbolMethod","VscSymbolNamespace","formatPayloadsForTable","pairs","hashes","schemas","bw","hash","push","schema","FlexCol","BoundWitnessPayloadTableBody","BoundWitnessPayloadTableHead","HeadingPaper","TableEx","React","VscSymbolMethod","BWPayloadTableFlexbox","IconComponent","eventNoun","hashes","schemas","headingTitle","props","resolvedIconComponent","VscSymbolMethod","FlexCol","alignItems","rowGap","HeadingPaper","heading","TableEx","BoundWitnessPayloadTableHead","BoundWitnessPayloadTableBody","payloadHashes","payloadSchemas","BlockBoundWitnessDetails","block","paper","children","props","boundWitness","payloads","hash","usePayloadHash","transactions","txFromBlockError","useTxsFromBlock","hashes","txHashes","schemas","txSchemas","useMemo","formatPayloadsForTable","nonTxBoundWitnesses","bwsFromBlockError","usePromise","bws","filterAs","payload","isTransactionBoundWitness","isBoundWitness","undefined","PayloadBuilder","hashPairs","nonTxBwHashes","nonTxBwSchemas","hasNonTxBoundWitnesses","length","React","FlexCol","alignItems","rowGap","ErrorRender","error","scope","HashHeadingPaper","paperProps","sx","p","AdornmentEnd","BWActions","boundwitness","identiconProps","size","Divider","flexItem","BWPayloadTableFlexbox","IconComponent","GrTransaction","eventNoun","headingTitle","mb","HeadingPaper","VscSymbolNamespace","heading","BoundWitnessPayloadsTable","VscSymbolMethod","FaSignature","BoundWitnessSignatureTable","Card","CardContent","Grid","Typography","isUndefined","bigIntToFixedPointString","React","useMemo","GiReceiveMoney","GiSandsOfTime","IoStatsChartOutline","MdOutlineAlternateEmail","Stack","styled","Tooltip","Typography","useTheme","isDefined","React","useMemo","DetailsStack","IconComponent","heading","children","tooltipTitle","props","theme","useTheme","hasTooltip","isDefined","resolvedIconComponent","useMemo","React","style","height","marginTop","marginLeft","spacing","Stack","direction","flexGrow","flexWrap","minWidth","SectionHeadingTypography","Tooltip","title","styled","Typography","name","display","fontFamily","lineHeight","marginBottom","Stack","Typography","useTheme","React","LabelValueStack","labels","values","props","theme","useTheme","React","Stack","flexDirection","flexGrow","map","label","Typography","fontWeight","key","variant","sx","borderBottom","vars","palette","divider","opacity","alignItems","value","index","fontFamily","width","display","justifyContent","formatFee","fee","isUndefined","stringValue","bigIntToFixedPointString","TransactionBoundWitnessCard","wrapper","props","stats","useMemo","labels","values","reward","toLocaleString","navigator","language","elevatedPayloadCount","payloadCount","signatureCount","fees","base","gasPrice","priority","gasLimit","blockDuration","boundWitness","exp","nbf","React","Card","CardContent","Grid","container","spacing","sx","width","size","xs","DetailsStack","IconComponent","MdOutlineAlternateEmail","heading","tooltipTitle","Typography","variant","maxWidth","textOverflow","overflow","fontFamily","from","sm","md","IoStatsChartOutline","LabelValueStack","GiReceiveMoney","GiSandsOfTime","ErrorRender","FlexCol","usePromise","isDefined","SignedHydratedTransactionWrapper","PayloadBuilder","BoundWitnessSignatureTable","BWActions","HashHeadingPaper","HeadingPaper","React","FaSignature","VscSymbolMethod","TransactionBoundWitnessDetails","transaction","props","wrapper","wrapperError","usePromise","SignedHydratedTransactionWrapper","parse","elevatedPayloadSets","elevatedPayloadSetsError","isDefined","elevatedPayloads","pairs","PayloadBuilder","hashPairs","formatPayloadsForTable","hashes","schemas","elevatedPayloadHashes","elevatedPayloadSchemas","React","FlexCol","alignItems","rowGap","HashHeadingPaper","hash","boundWitness","_hash","paperProps","sx","p","AdornmentEnd","BWActions","boundwitness","identiconProps","size","ErrorRender","error","scope","TransactionBoundWitnessCard","elevation","BWPayloadTableFlexbox","IconComponent","VscSymbolMethod","headingTitle","mb","HeadingPaper","FaSignature","heading","BoundWitnessSignatureTable","block"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/block/BlockBoundWitnessDetails.tsx","../../src/lib/formatPayloadsForTable.ts","../../src/components/BwPayloadTable.tsx","../../src/components/transactions/card/Card.tsx","../../src/components/transactions/TransactionDetails.tsx"],"sourcesContent":["import { Divider } from '@mui/material'\nimport { filterAs } from '@xylabs/array'\nimport { ErrorRender } from '@xylabs/react-error'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { usePromise } from '@xylabs/react-promise'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport {\n BoundWitnessPayloadsTable,\n BoundWitnessSignatureTable,\n BWActions,\n HashHeadingPaper,\n HeadingPaper,\n} from '@xyo-network/react-boundwitness-plugin'\nimport { useTxsFromBlock } from '@xyo-network/react-chain-blockchain'\nimport { usePayloadHash } from '@xyo-network/react-shared'\nimport { isTransactionBoundWitness, type SignedHydratedBlock } from '@xyo-network/xl1-protocol'\nimport React, { useMemo } from 'react'\nimport { FaSignature } from 'react-icons/fa'\nimport { GrTransaction } from 'react-icons/gr'\nimport { VscSymbolMethod, VscSymbolNamespace } from 'react-icons/vsc'\n\nimport { formatPayloadsForTable } from '../../lib/index.ts'\nimport type { TransactionBoundWitnessEvents } from '../../types/index.ts'\nimport { BWPayloadTableFlexbox } from '../BwPayloadTable.tsx'\n\nexport interface BoundWitnessDetailsProps extends FlexBoxProps {\n block?: SignedHydratedBlock\n}\n\nexport const BlockBoundWitnessDetails = ({\n block, paper, children, ...props\n}: BoundWitnessDetailsProps) => {\n const boundWitness = block?.[0]\n const payloads = block?.[1]\n\n const hash = usePayloadHash(boundWitness)\n\n const [transactions, txFromBlockError] = useTxsFromBlock(block)\n\n const { hashes: txHashes, schemas: txSchemas } = useMemo(() => formatPayloadsForTable(transactions ?? []), [transactions])\n\n const [nonTxBoundWitnesses, bwsFromBlockError] = usePromise(async () => {\n const bws = filterAs(payloads ?? [], payload =>\n (!isTransactionBoundWitness(payload) && isBoundWitness(payload)) ? payload : undefined)\n return await PayloadBuilder.hashPairs(bws)\n }, [payloads])\n\n const { hashes: nonTxBwHashes, schemas: nonTxBwSchemas } = useMemo(() => formatPayloadsForTable(nonTxBoundWitnesses ?? []), [nonTxBoundWitnesses])\n const hasNonTxBoundWitnesses = (nonTxBoundWitnesses?.length ?? 0) > 0\n\n return (\n <FlexCol alignItems=\"stretch\" rowGap={4} {...props}>\n <ErrorRender error={txFromBlockError ?? bwsFromBlockError} scope=\"BlockBoundWitnessDetails.tsx\" />\n <HashHeadingPaper\n hash={hash}\n paperProps={{ sx: { p: 2 } }}\n AdornmentEnd={<BWActions boundwitness={boundWitness} />}\n identiconProps={{ p: 0.75, size: 24 }}\n />\n <Divider flexItem />\n {(transactions?.length ?? 0) > 0 && (\n <BWPayloadTableFlexbox<TransactionBoundWitnessEvents>\n IconComponent={<GrTransaction />}\n eventNoun=\"transaction\"\n hashes={txHashes}\n headingTitle=\"Transactions\"\n schemas={txSchemas}\n sx={{ mb: 1 }}\n />\n )}\n <FlexCol alignItems=\"stretch\" rowGap={1} mb={1}>\n <HeadingPaper IconComponent={<VscSymbolNamespace />} heading=\"Payloads\" />\n <BoundWitnessPayloadsTable boundwitness={boundWitness} />\n </FlexCol>\n {hasNonTxBoundWitnesses\n ? (\n <BWPayloadTableFlexbox<TransactionBoundWitnessEvents>\n IconComponent={<VscSymbolMethod />}\n eventNoun=\"boundwitness\"\n hashes={nonTxBwHashes}\n headingTitle=\"Bound Witnesses\"\n schemas={nonTxBwSchemas}\n sx={{ mb: 1 }}\n />\n )\n : null}\n <FlexCol alignItems=\"stretch\" rowGap={1} mb={1}>\n <HeadingPaper IconComponent={<FaSignature />} heading=\"Signatures\" />\n <BoundWitnessSignatureTable block={boundWitness} />\n </FlexCol>\n </FlexCol>\n )\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport const formatPayloadsForTable = (pairs: [Payload, Hash][]) => {\n let hashes: Hash[] = []\n let schemas: string[] = []\n for (const [bw, hash] of pairs ?? []) {\n hashes.push(hash)\n schemas.push(bw?.schema ?? '')\n }\n return { hashes, schemas }\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport {\n BoundWitnessPayloadTableBody, BoundWitnessPayloadTableHead, HeadingPaper,\n} from '@xyo-network/react-boundwitness-plugin'\nimport type { EventNoun, ExtendEventNoun } from '@xyo-network/react-event'\nimport { TableEx } from '@xyo-network/react-table'\nimport React from 'react'\nimport { VscSymbolMethod } from 'react-icons/vsc'\n\nexport interface BWPayloadTableFlexboxProps<TNoun extends ExtendEventNoun = EventNoun> extends FlexBoxProps {\n IconComponent?: React.ReactNode\n eventNoun?: TNoun\n hashes?: Hash[]\n headingTitle?: string\n schemas?: string[]\n}\n\nexport const BWPayloadTableFlexbox = <TNoun extends ExtendEventNoun = EventNoun>({\n IconComponent,\n eventNoun,\n hashes,\n schemas,\n headingTitle,\n ...props\n}: BWPayloadTableFlexboxProps<TNoun>) => {\n const resolvedIconComponent = IconComponent ?? <VscSymbolMethod />\n return (\n <FlexCol alignItems=\"stretch\" rowGap={1} {...props}>\n <HeadingPaper IconComponent={resolvedIconComponent} heading={headingTitle} />\n <TableEx>\n <BoundWitnessPayloadTableHead />\n <BoundWitnessPayloadTableBody<TNoun> payloadHashes={hashes} payloadSchemas={schemas} eventNoun={eventNoun} />\n </TableEx>\n </FlexCol>\n )\n}\n","import type { CardProps } from '@mui/material'\nimport {\n Card, CardContent, Grid, Typography,\n} from '@mui/material'\nimport { isUndefined } from '@xylabs/typeof'\nimport { bigIntToFixedPointString } from '@xyo-network/chain-utils'\nimport { DetailsStack, LabelValueStack } from '@xyo-network/react-chain-shared'\nimport type { SignedHydratedTransactionInstance } from '@xyo-network/xl1-protocol-sdk'\nimport React, { useMemo } from 'react'\nimport { GiReceiveMoney, GiSandsOfTime } from 'react-icons/gi'\nimport { IoStatsChartOutline } from 'react-icons/io5'\nimport { MdOutlineAlternateEmail } from 'react-icons/md'\n\nconst formatFee = (fee?: bigint) => {\n if (isUndefined(fee)) return\n const stringValue = bigIntToFixedPointString(fee, 12)\n if (stringValue === '0') return '0.0'\n return stringValue\n}\n\nexport interface TransactionBoundWitnessCardProps extends CardProps {\n wrapper?: SignedHydratedTransactionInstance\n}\n\nexport const TransactionBoundWitnessCard: React.FC<TransactionBoundWitnessCardProps> = ({ wrapper, ...props }) => {\n if (!wrapper) return null\n\n const stats = useMemo(() => {\n const labels = [\n 'Reward',\n 'Elevated Payloads',\n 'Total Payloads',\n 'Signatures',\n ]\n\n const values: (string | undefined)[] = [\n wrapper.reward().toLocaleString(navigator.language ?? 'en-US'),\n wrapper.elevatedPayloadCount.toLocaleString(navigator.language ?? 'en-US'),\n wrapper.payloadCount.toLocaleString(navigator.language ?? 'en-US'),\n wrapper.signatureCount.toLocaleString(navigator.language ?? 'en-US'),,\n ]\n\n return { labels, values } as const\n }, [wrapper])\n\n const fees = useMemo(() => {\n const labels = [\n 'Base',\n 'Gas',\n 'Priority',\n 'Gas Limit',\n ]\n const values = [\n formatFee(wrapper.fees.base),\n formatFee(wrapper.fees.gasPrice),\n formatFee(wrapper.fees.priority),\n formatFee(wrapper.fees.gasLimit),\n ]\n\n return { labels, values } as const\n }, [wrapper])\n\n const blockDuration = useMemo(() => {\n const labels = [\n 'Expiration',\n 'Not Before',\n ]\n\n const values = [\n wrapper.boundWitness.exp.toLocaleString(navigator.language ?? 'en-US'),\n wrapper.boundWitness.nbf.toLocaleString(navigator.language ?? 'en-US'),\n ]\n\n return { labels, values } as const\n }, [wrapper])\n\n return (\n <Card {...props}>\n <CardContent>\n <Grid container spacing={6} sx={{ width: '100%' }}>\n <Grid size={{ xs: 12 }}>\n <DetailsStack IconComponent={MdOutlineAlternateEmail} heading=\"From:\" tooltipTitle=\"Address of the sender\">\n <Typography\n variant=\"body2\"\n sx={{\n maxWidth: '100%', textOverflow: 'ellipsis', overflow: 'hidden', fontFamily: 'monospace',\n }}\n >\n {wrapper?.boundWitness.from}\n </Typography>\n </DetailsStack>\n </Grid>\n <Grid size={{\n xs: 12, sm: 6, md: 4,\n }}\n >\n <DetailsStack IconComponent={IoStatsChartOutline} heading=\"Stats\" tooltipTitle=\"Transaction Statistics\">\n <LabelValueStack labels={stats.labels} values={stats.values} />\n </DetailsStack>\n </Grid>\n <Grid size={{\n xs: 12, sm: 6, md: 4,\n }}\n >\n <DetailsStack IconComponent={GiReceiveMoney} heading=\"Fees\" tooltipTitle=\"Fees offered to the producer\">\n <LabelValueStack labels={fees.labels} values={fees.values} />\n </DetailsStack>\n </Grid>\n <Grid size={{\n xs: 12, sm: 6, md: 4,\n }}\n >\n <DetailsStack IconComponent={GiSandsOfTime} heading=\"Block Duration\" tooltipTitle=\"Block window for the transaction to be valid\">\n <LabelValueStack labels={blockDuration.labels} values={blockDuration.values} />\n </DetailsStack>\n </Grid>\n </Grid>\n </CardContent>\n </Card>\n )\n}\n","import { ErrorRender } from '@xylabs/react-error'\nimport { type FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\nimport { usePromise } from '@xylabs/react-promise'\nimport { isDefined } from '@xylabs/typeof'\nimport { SignedHydratedTransactionWrapper } from '@xyo-network/chain-wrappers'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport {\n BoundWitnessSignatureTable, BWActions, HashHeadingPaper, HeadingPaper,\n} from '@xyo-network/react-boundwitness-plugin'\nimport type { SignedHydratedTransaction } from '@xyo-network/xl1-protocol'\nimport React from 'react'\nimport { FaSignature } from 'react-icons/fa'\nimport { VscSymbolMethod } from 'react-icons/vsc'\n\nimport { formatPayloadsForTable } from '../../lib/index.ts'\nimport { BWPayloadTableFlexbox } from '../BwPayloadTable.tsx'\nimport { TransactionBoundWitnessCard } from './card/index.ts'\n\nexport interface TransactionBoundWitnessDetailsProps extends FlexBoxProps {\n transaction?: SignedHydratedTransaction | null\n}\n\nexport const TransactionBoundWitnessDetails: React.FC<TransactionBoundWitnessDetailsProps> = ({ transaction, ...props }) => {\n const [wrapper, wrapperError] = usePromise(async () => {\n if (transaction) {\n return await SignedHydratedTransactionWrapper.parse(transaction)\n }\n }, [transaction])\n\n const [elevatedPayloadSets, elevatedPayloadSetsError] = usePromise(async () => {\n if (isDefined(wrapper)) {\n const elevatedPayloads = wrapper.elevatedPayloads\n const pairs = await PayloadBuilder.hashPairs(elevatedPayloads)\n return formatPayloadsForTable(pairs)\n } else {\n return { hashes: [], schemas: [] }\n }\n }, [wrapper])\n\n const { hashes: elevatedPayloadHashes, schemas: elevatedPayloadSchemas } = elevatedPayloadSets ?? {}\n\n return (\n <FlexCol alignItems=\"stretch\" rowGap={2} {...props}>\n <HashHeadingPaper\n hash={wrapper?.boundWitness?._hash}\n paperProps={{ sx: { p: 2 } }}\n AdornmentEnd={<BWActions boundwitness={wrapper?.boundWitness} />}\n identiconProps={{ p: 0.75, size: 24 }}\n />\n <ErrorRender error={wrapperError} scope=\"wrapperError:TransactionBoundWitnessDetails.tsx\" />\n <ErrorRender error={elevatedPayloadSetsError} scope=\"elevatedPayloadSetsError:TransactionBoundWitnessDetails.tsx\" />\n <TransactionBoundWitnessCard elevation={4} wrapper={wrapper} />\n <BWPayloadTableFlexbox\n IconComponent={<VscSymbolMethod />}\n hashes={elevatedPayloadHashes}\n headingTitle=\"Elevated Payloads\"\n schemas={elevatedPayloadSchemas}\n sx={{ mb: 1 }}\n />\n <FlexCol alignItems=\"stretch\" rowGap={1} mb={1}>\n <HeadingPaper IconComponent={<FaSignature />} heading=\"Signatures\" />\n <BoundWitnessSignatureTable block={wrapper?.boundWitness} />\n </FlexCol>\n </FlexCol>\n )\n}\n"],"mappings":";;;;AAAA,SAASA,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAE5B,SAASC,WAAAA,gBAAe;AACxB,SAASC,kBAAkB;AAC3B,SAASC,sBAAsB;AAC/B,SAASC,sBAAsB;AAC/B,SACEC,2BACAC,4BACAC,WACAC,kBACAC,gBAAAA,qBACK;AACP,SAASC,uBAAuB;AAChC,SAASC,sBAAsB;AAC/B,SAASC,iCAA2D;AACpE,OAAOC,UAASC,eAAe;AAC/B,SAASC,mBAAmB;AAC5B,SAASC,qBAAqB;AAC9B,SAASC,mBAAAA,kBAAiBC,0BAA0B;;;AClB7C,IAAMC,yBAAyB,wBAACC,UAAAA;AACrC,MAAIC,SAAiB,CAAA;AACrB,MAAIC,UAAoB,CAAA;AACxB,aAAW,CAACC,IAAIC,IAAAA,KAASJ,SAAS,CAAA,GAAI;AACpCC,WAAOI,KAAKD,IAAAA;AACZF,YAAQG,KAAKF,IAAIG,UAAU,EA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GAAQ;AAEZ,QAAM,EAAEa,QAAQE,uBAAuBD,SAASE,uBAAsB,IAAKX,uBAAuB,CAAC;AAEnG,SACE,gBAAAY,OAAA,cAACC,UAAAA;IAAQC,YAAW;IAAUC,QAAQ;IAAI,GAAGrB;KAC3C,gBAAAkB,OAAA,cAACI,mBAAAA;IACCC,MAAMtB,SAASuB,cAAcC;IAC7BC,YAAY;MAAEC,IAAI;QAAEC,GAAG;MAAE;IAAE;IAC3BC,cAAc,gBAAAX,OAAA,cAACY,YAAAA;MAAUC,cAAc9B,SAASuB;;IAChDQ,gBAAgB;MAAEJ,GAAG;MAAMK,MAAM;IAAG;MAEtC,gBAAAf,OAAA,cAACgB,cAAAA;IAAYC,OAAOjC;IAAckC,OAAM;MACxC,gBAAAlB,OAAA,cAACgB,cAAAA;IAAYC,OAAO5B;IAA0B6B,OAAM;MACpD,gBAAAlB,OAAA,cAACmB,6BAAAA;IAA4BC,WAAW;IAAGrC;MAC3C,gBAAAiB,OAAA,cAACqB,uBAAAA;IACCC,eAAe,gBAAAtB,OAAA,cAACuB,kBAAAA,IAAAA;IAChB3B,QAAQE;IACR0B,cAAa;IACb3B,SAASE;IACTU,IAAI;MAAEgB,IAAI;IAAE;MAEd,gBAAAzB,OAAA,cAACC,UAAAA;IAAQC,YAAW;IAAUC,QAAQ;IAAGsB,IAAI;KAC3C,gBAAAzB,OAAA,cAAC0B,eAAAA;IAAaJ,eAAe,gBAAAtB,OAAA,cAAC2B,cAAAA,IAAAA;IAAgBC,SAAQ;MACtD,gBAAA5B,OAAA,cAAC6B,6BAAAA;IAA2BC,OAAO/C,SAASuB;;AAIpD,GA3C6F;","names":["Divider","filterAs","ErrorRender","FlexCol","usePromise","isBoundWitness","PayloadBuilder","BoundWitnessPayloadsTable","BoundWitnessSignatureTable","BWActions","HashHeadingPaper","HeadingPaper","useTxsFromBlock","usePayloadHash","isTransactionBoundWitness","React","useMemo","FaSignature","GrTransaction","VscSymbolMethod","VscSymbolNamespace","formatPayloadsForTable","pairs","hashes","schemas","bw","hash","push","schema","FlexCol","BoundWitnessPayloadTableBody","BoundWitnessPayloadTableHead","HeadingPaper","TableEx","React","VscSymbolMethod","BWPayloadTableFlexbox","IconComponent","eventNoun","hashes","schemas","headingTitle","props","resolvedIconComponent","VscSymbolMethod","FlexCol","alignItems","rowGap","HeadingPaper","heading","TableEx","BoundWitnessPayloadTableHead","BoundWitnessPayloadTableBody","payloadHashes","payloadSchemas","BlockBoundWitnessDetails","block","paper","children","props","boundWitness","payloads","hash","usePayloadHash","transactions","txFromBlockError","useTxsFromBlock","hashes","txHashes","schemas","txSchemas","useMemo","formatPayloadsForTable","nonTxBoundWitnesses","bwsFromBlockError","usePromise","bws","filterAs","payload","isTransactionBoundWitness","isBoundWitness","undefined","PayloadBuilder","hashPairs","nonTxBwHashes","nonTxBwSchemas","hasNonTxBoundWitnesses","length","React","FlexCol","alignItems","rowGap","ErrorRender","error","scope","HashHeadingPaper","paperProps","sx","p","AdornmentEnd","BWActions","boundwitness","identiconProps","size","Divider","flexItem","BWPayloadTableFlexbox","IconComponent","GrTransaction","eventNoun","headingTitle","mb","HeadingPaper","VscSymbolNamespace","heading","BoundWitnessPayloadsTable","VscSymbolMethod","FaSignature","BoundWitnessSignatureTable","Card","CardContent","Grid","Typography","isUndefined","bigIntToFixedPointString","DetailsStack","LabelValueStack","React","useMemo","GiReceiveMoney","GiSandsOfTime","IoStatsChartOutline","MdOutlineAlternateEmail","formatFee","fee","isUndefined","stringValue","bigIntToFixedPointString","TransactionBoundWitnessCard","wrapper","props","stats","useMemo","labels","values","reward","toLocaleString","navigator","language","elevatedPayloadCount","payloadCount","signatureCount","fees","base","gasPrice","priority","gasLimit","blockDuration","boundWitness","exp","nbf","React","Card","CardContent","Grid","container","spacing","sx","width","size","xs","DetailsStack","IconComponent","MdOutlineAlternateEmail","heading","tooltipTitle","Typography","variant","maxWidth","textOverflow","overflow","fontFamily","from","sm","md","IoStatsChartOutline","LabelValueStack","GiReceiveMoney","GiSandsOfTime","ErrorRender","FlexCol","usePromise","isDefined","SignedHydratedTransactionWrapper","PayloadBuilder","BoundWitnessSignatureTable","BWActions","HashHeadingPaper","HeadingPaper","React","FaSignature","VscSymbolMethod","TransactionBoundWitnessDetails","transaction","props","wrapper","wrapperError","usePromise","SignedHydratedTransactionWrapper","parse","elevatedPayloadSets","elevatedPayloadSetsError","isDefined","elevatedPayloads","pairs","PayloadBuilder","hashPairs","formatPayloadsForTable","hashes","schemas","elevatedPayloadHashes","elevatedPayloadSchemas","React","FlexCol","alignItems","rowGap","HashHeadingPaper","hash","boundWitness","_hash","paperProps","sx","p","AdornmentEnd","BWActions","boundwitness","identiconProps","size","ErrorRender","error","scope","TransactionBoundWitnessCard","elevation","BWPayloadTableFlexbox","IconComponent","VscSymbolMethod","headingTitle","mb","HeadingPaper","FaSignature","heading","BoundWitnessSignatureTable","block"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../../src/components/transactions/card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../../src/components/transactions/card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAO9C,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,+BAA+B,CAAA;AACtF,OAAO,KAAkB,MAAM,OAAO,CAAA;AAYtC,MAAM,WAAW,gCAAiC,SAAQ,SAAS;IACjE,OAAO,CAAC,EAAE,iCAAiC,CAAA;CAC5C;AAED,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC,gCAAgC,CAgGlF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/react-chain-boundwitness",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.8",
|
|
5
5
|
"description": "XYO Layer One React SDK BoundWitness",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -41,17 +41,18 @@
|
|
|
41
41
|
"@xylabs/react-promise": "^6.3.4",
|
|
42
42
|
"@xylabs/typeof": "^4.11.8",
|
|
43
43
|
"@xyo-network/boundwitness-model": "^3.18.0",
|
|
44
|
-
"@xyo-network/chain-utils": "^1.5.
|
|
45
|
-
"@xyo-network/chain-wrappers": "^1.5.
|
|
44
|
+
"@xyo-network/chain-utils": "^1.5.8",
|
|
45
|
+
"@xyo-network/chain-wrappers": "^1.5.8",
|
|
46
46
|
"@xyo-network/payload-builder": "^3.18.0",
|
|
47
47
|
"@xyo-network/payload-model": "^3.18.0",
|
|
48
48
|
"@xyo-network/react-boundwitness-plugin": "^5.3.6",
|
|
49
|
-
"@xyo-network/react-chain-blockchain": "^1.5.
|
|
49
|
+
"@xyo-network/react-chain-blockchain": "^1.5.8",
|
|
50
|
+
"@xyo-network/react-chain-shared": "^1.5.8",
|
|
50
51
|
"@xyo-network/react-event": "^5.3.6",
|
|
51
52
|
"@xyo-network/react-shared": "^5.3.6",
|
|
52
53
|
"@xyo-network/react-table": "^5.3.6",
|
|
53
54
|
"@xyo-network/xl1-protocol": "^1.4.14",
|
|
54
|
-
"@xyo-network/xl1-protocol-sdk": "^1.5.
|
|
55
|
+
"@xyo-network/xl1-protocol-sdk": "^1.5.8",
|
|
55
56
|
"react-icons": "^5.5.0"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
@@ -62,8 +63,8 @@
|
|
|
62
63
|
"@storybook/react": "^8.6.14",
|
|
63
64
|
"@xylabs/ts-scripts-yarn3": "^6.5.7",
|
|
64
65
|
"@xylabs/tsconfig-react": "^6.5.7",
|
|
65
|
-
"@xyo-network/chain-protocol": "^1.5.
|
|
66
|
-
"@xyo-network/react-chain-shared": "^1.5.
|
|
66
|
+
"@xyo-network/chain-protocol": "^1.5.8",
|
|
67
|
+
"@xyo-network/react-chain-shared": "^1.5.8",
|
|
67
68
|
"knip": "^5.59.1",
|
|
68
69
|
"react": "^19.1.0",
|
|
69
70
|
"react-dom": "^19.1.0",
|
|
@@ -4,15 +4,13 @@ import {
|
|
|
4
4
|
} from '@mui/material'
|
|
5
5
|
import { isUndefined } from '@xylabs/typeof'
|
|
6
6
|
import { bigIntToFixedPointString } from '@xyo-network/chain-utils'
|
|
7
|
+
import { DetailsStack, LabelValueStack } from '@xyo-network/react-chain-shared'
|
|
7
8
|
import type { SignedHydratedTransactionInstance } from '@xyo-network/xl1-protocol-sdk'
|
|
8
9
|
import React, { useMemo } from 'react'
|
|
9
10
|
import { GiReceiveMoney, GiSandsOfTime } from 'react-icons/gi'
|
|
10
11
|
import { IoStatsChartOutline } from 'react-icons/io5'
|
|
11
12
|
import { MdOutlineAlternateEmail } from 'react-icons/md'
|
|
12
13
|
|
|
13
|
-
import { DetailsStack } from './DetailsStack.tsx'
|
|
14
|
-
import { LabelValueStack } from './LabelValueStack.tsx'
|
|
15
|
-
|
|
16
14
|
const formatFee = (fee?: bigint) => {
|
|
17
15
|
if (isUndefined(fee)) return
|
|
18
16
|
const stringValue = bigIntToFixedPointString(fee, 12)
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { StackProps } from '@mui/material';
|
|
2
|
-
import type { ComponentType, SVGAttributes } from 'react';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
export interface DetailsStackProps extends StackProps {
|
|
5
|
-
IconComponent?: ComponentType<SVGAttributes<SVGElement>>;
|
|
6
|
-
heading?: string;
|
|
7
|
-
tooltipTitle?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const DetailsStack: React.FC<DetailsStackProps>;
|
|
10
|
-
//# sourceMappingURL=DetailsStack.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DetailsStack.d.ts","sourceRoot":"","sources":["../../../../../src/components/transactions/card/DetailsStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/C,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,aAAa,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAA;IACxD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAoCpD,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { StackProps } from '@mui/material';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface LabelValueStackProps extends StackProps {
|
|
4
|
-
labels: string[];
|
|
5
|
-
values: (string | undefined)[];
|
|
6
|
-
}
|
|
7
|
-
export declare const LabelValueStack: React.FC<LabelValueStackProps>;
|
|
8
|
-
//# sourceMappingURL=LabelValueStack.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LabelValueStack.d.ts","sourceRoot":"","sources":["../../../../../src/components/transactions/card/LabelValueStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI/C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,MAAM,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAA;CAC/B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAsC1D,CAAA"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { StackProps } from '@mui/material'
|
|
2
|
-
import {
|
|
3
|
-
Stack, styled, Tooltip, Typography,
|
|
4
|
-
useTheme,
|
|
5
|
-
} from '@mui/material'
|
|
6
|
-
import { isDefined } from '@xylabs/typeof'
|
|
7
|
-
import type { ComponentType, SVGAttributes } from 'react'
|
|
8
|
-
import React, { useMemo } from 'react'
|
|
9
|
-
|
|
10
|
-
export interface DetailsStackProps extends StackProps {
|
|
11
|
-
IconComponent?: ComponentType<SVGAttributes<SVGElement>>
|
|
12
|
-
heading?: string
|
|
13
|
-
tooltipTitle?: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const DetailsStack: React.FC<DetailsStackProps> = ({
|
|
17
|
-
IconComponent, heading, children, tooltipTitle, ...props
|
|
18
|
-
}) => {
|
|
19
|
-
const theme = useTheme()
|
|
20
|
-
|
|
21
|
-
const hasTooltip = isDefined(tooltipTitle)
|
|
22
|
-
const resolvedIconComponent = useMemo(() => {
|
|
23
|
-
return IconComponent
|
|
24
|
-
? (
|
|
25
|
-
<IconComponent
|
|
26
|
-
style={{
|
|
27
|
-
/** height and marginTop adjusted to account for font not filling container with line-height: 1 */
|
|
28
|
-
height: '0.85rem',
|
|
29
|
-
marginTop: 0.5,
|
|
30
|
-
marginLeft: theme.spacing(1),
|
|
31
|
-
}}
|
|
32
|
-
/>
|
|
33
|
-
)
|
|
34
|
-
: <></>
|
|
35
|
-
}, [IconComponent])
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<Stack direction="column" flexGrow={1} flexWrap="wrap" minWidth="1px" {...props}>
|
|
39
|
-
<SectionHeadingTypography>
|
|
40
|
-
{heading}
|
|
41
|
-
{hasTooltip
|
|
42
|
-
? (
|
|
43
|
-
<Tooltip title={tooltipTitle}>
|
|
44
|
-
{resolvedIconComponent}
|
|
45
|
-
</Tooltip>
|
|
46
|
-
)
|
|
47
|
-
: resolvedIconComponent}
|
|
48
|
-
</SectionHeadingTypography>
|
|
49
|
-
{children}
|
|
50
|
-
</Stack>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const SectionHeadingTypography = styled(Typography, { name: 'SectionHeadingTypography' })(({ theme }) => ({
|
|
55
|
-
display: 'flex',
|
|
56
|
-
fontFamily: 'monospace',
|
|
57
|
-
lineHeight: 1,
|
|
58
|
-
marginBottom: theme.spacing(1.5),
|
|
59
|
-
}))
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { StackProps } from '@mui/material'
|
|
2
|
-
import {
|
|
3
|
-
Stack, Typography, useTheme,
|
|
4
|
-
} from '@mui/material'
|
|
5
|
-
import React from 'react'
|
|
6
|
-
|
|
7
|
-
export interface LabelValueStackProps extends StackProps {
|
|
8
|
-
labels: string[]
|
|
9
|
-
values: (string | undefined)[]
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const LabelValueStack: React.FC<LabelValueStackProps> = ({
|
|
13
|
-
labels, values, ...props
|
|
14
|
-
}) => {
|
|
15
|
-
const theme = useTheme()
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<Stack flexDirection="row" flexGrow={1} {...props}>
|
|
19
|
-
<Stack>
|
|
20
|
-
{labels.map(label => (
|
|
21
|
-
<Typography
|
|
22
|
-
fontWeight="300"
|
|
23
|
-
key={label}
|
|
24
|
-
variant="body2"
|
|
25
|
-
sx={{ borderBottom: `1px solid ${theme.vars?.palette.divider}`, opacity: 0.7 }}
|
|
26
|
-
>
|
|
27
|
-
{label}
|
|
28
|
-
:
|
|
29
|
-
</Typography>
|
|
30
|
-
))}
|
|
31
|
-
</Stack>
|
|
32
|
-
<Stack alignItems="end" flexGrow={1}>
|
|
33
|
-
{values.map((value, index) => (
|
|
34
|
-
<Typography
|
|
35
|
-
fontFamily="monospace"
|
|
36
|
-
variant="body2"
|
|
37
|
-
// Use matching label as key since values might be the same
|
|
38
|
-
key={labels[index]}
|
|
39
|
-
width="100%"
|
|
40
|
-
sx={{
|
|
41
|
-
display: 'flex', justifyContent: 'end', borderBottom: `1px solid ${theme.vars?.palette.divider}`,
|
|
42
|
-
}}
|
|
43
|
-
>
|
|
44
|
-
{value}
|
|
45
|
-
</Typography>
|
|
46
|
-
))}
|
|
47
|
-
</Stack>
|
|
48
|
-
</Stack>
|
|
49
|
-
)
|
|
50
|
-
}
|