@myrjfa/ui 1.0.5 → 1.0.6
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,8 +1,9 @@
|
|
|
1
|
-
declare const DocumentPreviewButton: ({ filepath, label, icon, size, }: {
|
|
1
|
+
declare const DocumentPreviewButton: ({ filepath, label, icon, size, labelInMobile, }: {
|
|
2
2
|
filepath: string | File;
|
|
3
3
|
label?: string;
|
|
4
4
|
icon?: any;
|
|
5
5
|
size?: "icon" | "lg" | "sm" | "default";
|
|
6
|
+
labelInMobile?: boolean;
|
|
6
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default DocumentPreviewButton;
|
|
8
9
|
//# sourceMappingURL=file-preview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-preview.d.ts","sourceRoot":"","sources":["../../src/misc/file-preview.tsx"],"names":[],"mappings":"AAuBA,QAAA,MAAM,qBAAqB,GAAI,
|
|
1
|
+
{"version":3,"file":"file-preview.d.ts","sourceRoot":"","sources":["../../src/misc/file-preview.tsx"],"names":[],"mappings":"AAuBA,QAAA,MAAM,qBAAqB,GAAI,iDAM5B;IACC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IACxC,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B,4CAsEA,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -56,8 +56,8 @@ var imageTypes = ["jpg", "jpeg", "png", "gif", "webp"];
|
|
|
56
56
|
var videotypes = ["mp4", "webm"];
|
|
57
57
|
var docTypes = ["pdf"];
|
|
58
58
|
var DocumentPreviewButton = function (_a) {
|
|
59
|
-
var filepath = _a.filepath, label = _a.label, icon = _a.icon, _b = _a.size, size = _b === void 0 ? 'default' : _b;
|
|
60
|
-
var
|
|
59
|
+
var filepath = _a.filepath, label = _a.label, icon = _a.icon, _b = _a.size, size = _b === void 0 ? 'default' : _b, _c = _a.labelInMobile, labelInMobile = _c === void 0 ? false : _c;
|
|
60
|
+
var _d = useState(false), loading = _d[0], setLoading = _d[1];
|
|
61
61
|
var labelInternal = label;
|
|
62
62
|
var IconInternal = icon || _jsx(FileIcon, { className: "h-8 w-8 text-chart-2" });
|
|
63
63
|
if (typeof filepath === 'string') {
|
|
@@ -125,6 +125,6 @@ var DocumentPreviewButton = function (_a) {
|
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
}); };
|
|
128
|
-
return (
|
|
128
|
+
return (_jsx("div", { className: "flex flex-col items-center", children: _jsxs(Button, { variant: "outline", size: size, className: "w-full cursor-pointer flex md:flex", onClick: handleOpenFile, disabled: loading, children: [IconInternal, _jsx("span", { className: "".concat(labelInMobile ? "inline" : "hidden", " md:inline"), children: labelInternal })] }) }));
|
|
129
129
|
};
|
|
130
130
|
export default DocumentPreviewButton;
|