From ab234e2beec4c9bfabe463491c6a094d36b67be1 Mon Sep 17 00:00:00 2001 From: seveibar Date: Sat, 12 Oct 2024 19:54:20 -0400 Subject: [PATCH] update improvement --- src/components/CodeAndPreview.tsx | 8 +++++++- src/components/dialogs/import-snippet-dialog.tsx | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/CodeAndPreview.tsx b/src/components/CodeAndPreview.tsx index 44f01b54..1bfd6e7b 100644 --- a/src/components/CodeAndPreview.tsx +++ b/src/components/CodeAndPreview.tsx @@ -188,7 +188,13 @@ export function CodeAndPreview({ snippet }: Props) { /> )} - + { + setCode( + `import {} from "@tsci/${snippet.owner_name}.${snippet.unscoped_name}"\n${snippet.code}`, + ) + }} + /> ) } diff --git a/src/components/dialogs/import-snippet-dialog.tsx b/src/components/dialogs/import-snippet-dialog.tsx index 806fed82..797ed44c 100644 --- a/src/components/dialogs/import-snippet-dialog.tsx +++ b/src/components/dialogs/import-snippet-dialog.tsx @@ -46,7 +46,12 @@ export const ImportSnippetDialog = ({
    {snippets?.map((snippet: Snippet) => (
  • -