From f417ada44abd5a496da62f986f68d7734ce98566 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Tue, 1 Apr 2025 11:38:57 -0600 Subject: [PATCH] Update CodeCard.tsx --- web/src/components/ui/card/CodeCard.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/web/src/components/ui/card/CodeCard.tsx b/web/src/components/ui/card/CodeCard.tsx index 5ec15d094..25096e57f 100644 --- a/web/src/components/ui/card/CodeCard.tsx +++ b/web/src/components/ui/card/CodeCard.tsx @@ -33,7 +33,11 @@ export const CodeCard: React.FC<{ error = '' }) => { const ShownButtons = - buttons === true ? : buttons; + buttons === true ? ( + + ) : ( + buttons + ); return ( @@ -66,7 +70,8 @@ CodeCard.displayName = 'CodeCard'; const CardButtons: React.FC<{ fileName: string; code: string; -}> = React.memo(({ fileName, code }) => { + language: string; +}> = React.memo(({ fileName, code, language }) => { const { openInfoMessage, openErrorMessage } = useBusterNotifications(); const handleCopyCode = useMemoizedFn(async () => { @@ -84,7 +89,7 @@ const CardButtons: React.FC<{ const url = window.URL.createObjectURL(blob); const link = document.createElement('a'); link.href = url; - link.download = fileName; + link.download = `${fileName}.${language}`; //this is actually not a good idea... document.body.appendChild(link); link.click(); document.body.removeChild(link);