(false);
+
+ return (
+ <>
+ {
+ navigator.clipboard.writeText(
+ typeof props.text === "string" ? props.text : props.text(),
+ );
+ setCopied(true);
+ setTimeout(() => setCopied(false), 2000);
+ }}
+ >
+ {copied ? (
+
+ ) : (
+
+ )}
+
+ >
+ );
+}
diff --git a/gui/src/pages/stats.tsx b/gui/src/pages/stats.tsx
index 7c9d8f09c..74942795f 100644
--- a/gui/src/pages/stats.tsx
+++ b/gui/src/pages/stats.tsx
@@ -2,7 +2,9 @@ import { ArrowLeftIcon } from "@heroicons/react/24/outline";
import { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import styled from "styled-components";
+import { table } from "table";
import { lightGray, vscBackground, vscInputBackground } from "../components";
+import { CopyButton } from "../components/markdown/CopyButton";
import { useNavigationListener } from "../hooks/useNavigationListener";
import { ideRequest } from "../util/ide";
@@ -27,6 +29,10 @@ const Td = styled.td`
border: 1px solid ${vscInputBackground};
`;
+function generateTable(data: unknown[][]) {
+ return table(data);
+}
+
function Stats() {
useNavigationListener();
const navigate = useNavigate();
@@ -65,7 +71,16 @@ function Stats() {
My Usage
- Tokens per Day
+
+
Tokens per Day
+ [day.day, day.tokens]),
+ ),
+ )}
+ />
+
@@ -83,7 +98,16 @@ function Stats() {
- Tokens per Model
+
+
Tokens per Model
+ [model.model, model.tokens]),
+ ),
+ )}
+ />
+