Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+2
-3
@@ -1,8 +1,7 @@
|
||||
import clsx from "clsx";
|
||||
import { ReactNode, useState } from "react";
|
||||
import Modal from "../modals/Modal";
|
||||
import ModalOrSlide from "../modals/ModalOrSlide";
|
||||
import { Button, buttonVariants } from "../button";
|
||||
import { Button } from "../button";
|
||||
|
||||
interface Props {
|
||||
title: ReactNode;
|
||||
@@ -21,7 +20,7 @@ interface Props {
|
||||
export default function ShowModalButton({
|
||||
title,
|
||||
children,
|
||||
className = "sm:max-w-md",
|
||||
className: _className = "sm:max-w-md",
|
||||
type = "modal",
|
||||
size = "lg",
|
||||
buttons,
|
||||
|
||||
+4
-6
@@ -2,7 +2,7 @@ import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import Modal from "../modals/Modal";
|
||||
import clsx from "clsx";
|
||||
import toast from "react-hot-toast";
|
||||
import { useCopyToast } from "~/hooks/use-copy-toast";
|
||||
|
||||
export default function ShowPayloadModalButton({
|
||||
payload,
|
||||
@@ -21,6 +21,7 @@ export default function ShowPayloadModalButton({
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [open, setOpen] = useState(false);
|
||||
const copyText = useCopyToast();
|
||||
|
||||
function stringifyDetails() {
|
||||
if (typeof payload === "string") {
|
||||
@@ -28,7 +29,7 @@ export default function ShowPayloadModalButton({
|
||||
}
|
||||
try {
|
||||
return JSON.stringify(JSON.parse(payload ?? "{}"), null, "\t");
|
||||
} catch (e) {
|
||||
} catch (_e) {
|
||||
return JSON.stringify(payload, null, "\t");
|
||||
}
|
||||
}
|
||||
@@ -54,10 +55,7 @@ export default function ShowPayloadModalButton({
|
||||
{withCopy && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(stringifyDetails());
|
||||
toast.success(t("shared.copied"));
|
||||
}}
|
||||
onClick={() => void copyText(stringifyDetails(), { successKey: "shared.copyToast.jsonCopied" })}
|
||||
className="bg-theme-100 text-theme-700 hover:bg-theme-200 focus:shadow-focus inline-flex items-center rounded-md border border-transparent px-3 py-2 text-sm font-medium leading-4 focus:outline-hidden"
|
||||
>
|
||||
{t("shared.copy")}
|
||||
|
||||
Reference in new issue
Block a user