@muhgholy/next-drive 3.1.0 → 3.2.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../src/client/components/drive/upload.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAwC,MAAM,OAAO,CAAC;AA0E7D,eAAO,MAAM,WAAW,GAAI,OAAO,QAAQ,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC,sBAgQD,CAAC"}
1
+ {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../src/client/components/drive/upload.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAwC,MAAM,OAAO,CAAC;AA8G7D,eAAO,MAAM,WAAW,GAAI,OAAO,QAAQ,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC,sBAgQD,CAAC"}
@@ -2049,8 +2049,46 @@ var UploadStatusIcon = (props) => {
2049
2049
  var LogViewerDialog = (props) => {
2050
2050
  const { upload, open, onOpenChange } = props;
2051
2051
  const logs = upload.logs || [];
2052
+ const handleCopy = () => {
2053
+ const logText = logs.map((log) => `[${new Date(log.timestamp).toLocaleTimeString()}] ${log.type.toUpperCase()}: ${log.message}`).join("\n");
2054
+ navigator.clipboard.writeText(logText);
2055
+ };
2056
+ const handleDownload = () => {
2057
+ const logText = logs.map((log) => `[${new Date(log.timestamp).toLocaleTimeString()}] ${log.type.toUpperCase()}: ${log.message}`).join("\n");
2058
+ const blob = new Blob([logText], { type: "text/plain" });
2059
+ const url = URL.createObjectURL(blob);
2060
+ const a = document.createElement("a");
2061
+ a.href = url;
2062
+ a.download = `${upload.name}-logs.txt`;
2063
+ a.click();
2064
+ URL.revokeObjectURL(url);
2065
+ };
2052
2066
  return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-lg p-0 gap-0 max-h-[85vh] flex flex-col", children: [
2053
2067
  /* @__PURE__ */ jsx(DialogHeader, { className: "px-4 py-3 border-b", children: /* @__PURE__ */ jsx(DialogTitle, { className: "text-base truncate", children: upload.name }) }),
2068
+ /* @__PURE__ */ jsxs("div", { className: "sticky top-0 z-10 bg-background px-4 py-2 border-b flex items-center gap-2", children: [
2069
+ /* @__PURE__ */ jsx(
2070
+ Button,
2071
+ {
2072
+ type: "button",
2073
+ size: "sm",
2074
+ variant: "outline",
2075
+ onClick: handleCopy,
2076
+ disabled: logs.length === 0,
2077
+ children: "Copy"
2078
+ }
2079
+ ),
2080
+ /* @__PURE__ */ jsx(
2081
+ Button,
2082
+ {
2083
+ type: "button",
2084
+ size: "sm",
2085
+ variant: "outline",
2086
+ onClick: handleDownload,
2087
+ disabled: logs.length === 0,
2088
+ children: "Download"
2089
+ }
2090
+ )
2091
+ ] }),
2054
2092
  /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto p-4 space-y-2", children: [
2055
2093
  logs.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground text-center py-8", children: "No logs available" }),
2056
2094
  logs.map((log, index) => /* @__PURE__ */ jsxs(