From 82add244b9e48f7c4a5e35258ea1421ff954acbb Mon Sep 17 00:00:00 2001 From: Paolo Tiu Date: Thu, 5 Jan 2023 00:44:41 +0800 Subject: [PATCH] feat: add copy to clipboard button in response --- .../form/ProcedureForm/FormSection.tsx | 2 +- .../form/ProcedureForm/Response.tsx | 33 ++++++++++++++++--- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/packages/trpc-panel/src/react-app/components/form/ProcedureForm/FormSection.tsx b/packages/trpc-panel/src/react-app/components/form/ProcedureForm/FormSection.tsx index c123c0e..65450fc 100644 --- a/packages/trpc-panel/src/react-app/components/form/ProcedureForm/FormSection.tsx +++ b/packages/trpc-panel/src/react-app/components/form/ProcedureForm/FormSection.tsx @@ -20,7 +20,7 @@ export function FormSection({ {topRightElement} -
{children}
+
{children}
); } diff --git a/packages/trpc-panel/src/react-app/components/form/ProcedureForm/Response.tsx b/packages/trpc-panel/src/react-app/components/form/ProcedureForm/Response.tsx index 7115048..1a797ca 100644 --- a/packages/trpc-panel/src/react-app/components/form/ProcedureForm/Response.tsx +++ b/packages/trpc-panel/src/react-app/components/form/ProcedureForm/Response.tsx @@ -1,10 +1,33 @@ import React from "react"; +import { toast } from "react-hot-toast"; import { FormSection } from "./FormSection"; export function Response({ children }: { children: string }) { - return ( - -

{children}

-
- ); + return ( + + +

{children}

+
+ ); }