From d4be3906e32ac7d9933c6030d6493f2f2152bdd9 Mon Sep 17 00:00:00 2001
From: Florian Dold <florian.dold@gmail.com>
Date: Wed, 12 Oct 2016 02:55:53 +0200
Subject: tree view of wallet db

---
 lib/wallet/renderHtml.tsx | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'lib/wallet/renderHtml.tsx')

diff --git a/lib/wallet/renderHtml.tsx b/lib/wallet/renderHtml.tsx
index db0f00ec5..52c01cd09 100644
--- a/lib/wallet/renderHtml.tsx
+++ b/lib/wallet/renderHtml.tsx
@@ -47,4 +47,17 @@ export function renderContract(contract: Contract): JSX.Element {
       </ul>
     </div>
   );
+}
+
+
+export function abbrev(s: string, n: number = 5) {
+  let sAbbrev = s;
+  if (s.length > n) {
+    sAbbrev = s.slice(0, n) + "..";
+  }
+  return (
+    <span className="abbrev" title={s}>
+      {sAbbrev}
+    </span>
+  );
 }
\ No newline at end of file
-- 
cgit v1.2.3

