feat: add link for download ledger entries to .csv - make assetId selectable

This commit is contained in:
maciek
2023-04-24 11:11:43 +02:00
parent 26cbce6612
commit 325606c53b
+3 -3
View File
@@ -45,11 +45,11 @@ const LedgerEntriesExportLink = ({
entries: LedgerEntry[];
}) => {
const assets = entries.reduce((aggr, item) => {
if (!(item.assetId in aggr && item.asset?.name)) {
aggr[item.assetId] = item.asset.name;
if (item.asset && !(item.asset.id in aggr)) {
aggr[item.asset.id] = item.asset.name;
}
return aggr;
}, {});
}, {} as Record<string, string>);
const [assetId, setAssetId] = useState(Object.keys(assets)[0]);
const VEGA_URL = useEnvironment((store) => store.VEGA_URL);
const protohost = VEGA_URL ? getProtoHost(VEGA_URL) : '';