From 76178ace79ad8d96ec8fbe8efe37445d3db8844b Mon Sep 17 00:00:00 2001 From: Zeu Capua Date: Wed, 21 Aug 2024 10:44:40 -0700 Subject: [PATCH] wrap OssfChart with CopyContainer, don't show copy button if error --- components/shared/CopyContainer.tsx | 3 ++ pages/s/[org]/[repo]/index.tsx | 48 +++++++++++++++++++++++------ 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/components/shared/CopyContainer.tsx b/components/shared/CopyContainer.tsx index 0c8524524..eb61fa3eb 100644 --- a/components/shared/CopyContainer.tsx +++ b/components/shared/CopyContainer.tsx @@ -9,6 +9,7 @@ interface CopyContainerProps { copySuccessMessage?: string; copyErrorMessage?: string; options?: Partial; + onCopyClick?: () => void; children: React.ReactNode; } @@ -16,6 +17,7 @@ export const CopyContainer = ({ copySuccessMessage = "Copied image to clipboard", copyErrorMessage = "Error copying image", options, + onCopyClick, children, }: CopyContainerProps) => { const { toast } = useToast(); @@ -27,6 +29,7 @@ export const CopyContainer = ({