From 4a2bbab52f9a829b86ddb3ce82f31ea6ab415311 Mon Sep 17 00:00:00 2001
From: Pedro Carreno <34664891+Pkcarreno@users.noreply.github.com>
Date: Sun, 29 Dec 2024 01:01:06 -0400
Subject: [PATCH] feat: improve script details section
---
.../editor/components/header/index.tsx | 3 +-
.../editor/components/header/info/index.tsx | 57 ++++++++++++-------
.../components/header/info/info-form.tsx | 36 ++++++++++++
3 files changed, 72 insertions(+), 24 deletions(-)
diff --git a/src/features/editor/components/header/index.tsx b/src/features/editor/components/header/index.tsx
index ac5c82a..f62b602 100644
--- a/src/features/editor/components/header/index.tsx
+++ b/src/features/editor/components/header/index.tsx
@@ -3,7 +3,7 @@ import { useMemo } from 'react';
import { ActionButtons } from './action-buttons';
import { AutorunToggler } from './autorun-toggler';
-import { InfoEdit, InfoTitle } from './info';
+import { InfoTitle } from './info';
import { LayoutDirectionToggler } from './layout-direction-toggler';
import { MainMenu } from './main-menu';
import { OpenInSite } from './open-in-site';
@@ -22,7 +22,6 @@ export const Header = () => {
-
diff --git a/src/features/editor/components/header/info/index.tsx b/src/features/editor/components/header/info/index.tsx
index 9d4bb23..bfc1447 100644
--- a/src/features/editor/components/header/info/index.tsx
+++ b/src/features/editor/components/header/info/index.tsx
@@ -1,5 +1,4 @@
-import { InfoCircledIcon } from '@radix-ui/react-icons';
-import { useCallback, useMemo, useState } from 'react';
+import { useMemo } from 'react';
import { Button } from '@/components/ui/button';
import {
@@ -11,7 +10,7 @@ import {
} from '@/components/ui/dialog';
import { useCodeStore } from '@/features/editor/stores/editor';
-import { InfoForm } from './info-form';
+import { InfoFormDialog } from './info-form';
interface InfoDialogProps {
children: React.ReactNode;
@@ -22,45 +21,59 @@ export const InfoDialog: React.FC
= ({
children,
asChild,
}) => {
- const [open, setOpen] = useState(false);
-
- const closeDialog = useCallback(() => {
- setOpen(false);
- }, []);
-
return (
-