-
-
- Report an Issue
-
+
+ setAISettingsOpen(true)}
+ className="flex items-center gap-2 w-full"
+ >
+
+ AI Settings
@@ -388,88 +252,17 @@ export function ProjectSidebar({
{project.name}
-
- {isFavorite(project.id) && (
-
- )}
-
- {/* Dropdown Menu */}
+ {/* Star Button */}
-
-
- e.stopPropagation()}
- >
-
-
-
-
- handleToggleFavorite(project)}
- >
-
- {isFavorite(project.id) ? "Unfavorite" : "Favorite"}
-
- navigate(`/project/${project.id}`)}
- >
-
- Open Project
-
- handleExportProject(project)}
- disabled={isExporting}
- >
-
- {isExporting ? 'Exporting...' : 'Export Project'}
-
-
-
- e.preventDefault()}
- >
-
- Delete Project
-
-
-
-
- Delete Project
-
- Are you sure you want to delete "{project.name}"? This action cannot be undone and will permanently delete all project data including files.
-
-
-
- Cancel
- handleDeleteProject(project)}
- disabled={isDeleting}
- className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
- >
- {isDeleting ? (
- <>
-
- Deleting...
- >
- ) : (
- 'Delete Project'
- )}
-
-
-
-
-
-
+
@@ -485,6 +278,12 @@ export function ProjectSidebar({
+
+ {/* AI Settings Dialog */}
+
);
}
\ No newline at end of file
diff --git a/src/components/StarButton.tsx b/src/components/StarButton.tsx
new file mode 100644
index 00000000..19c76beb
--- /dev/null
+++ b/src/components/StarButton.tsx
@@ -0,0 +1,65 @@
+import { Button } from '@/components/ui/button';
+import { Star } from 'lucide-react';
+import { useLocalStorage } from '@/hooks/useLocalStorage';
+import { useToast } from '@/hooks/useToast';
+import { cn } from '@/lib/utils';
+
+interface StarButtonProps {
+ projectId: string;
+ projectName: string;
+ className?: string;
+ size?: 'sm' | 'default' | 'lg';
+ variant?: 'ghost' | 'outline' | 'default';
+ showToast?: boolean;
+}
+
+export function StarButton({
+ projectId,
+ projectName,
+ className,
+ size = 'sm',
+ variant = 'ghost',
+ showToast = true
+}: StarButtonProps) {
+ const [favorites, setFavorites] = useLocalStorage('project-favorites', []);
+ const { toast } = useToast();
+
+ const isFavorite = favorites.includes(projectId);
+
+ const handleToggleFavorite = (e: React.MouseEvent) => {
+ e.stopPropagation(); // Prevent triggering parent click events
+
+ const newFavorites = isFavorite
+ ? favorites.filter(id => id !== projectId)
+ : [...favorites, projectId];
+
+ setFavorites(newFavorites);
+
+ if (showToast) {
+ toast({
+ title: isFavorite ? "Project Unfavorited" : "Project Favorited",
+ description: `"${projectName}" has been ${isFavorite ? 'removed from' : 'added to'} your favorites.`,
+ });
+ }
+ };
+
+ return (
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/src/pages/ProjectView.tsx b/src/pages/ProjectView.tsx
index f584769d..20ac0bf4 100644
--- a/src/pages/ProjectView.tsx
+++ b/src/pages/ProjectView.tsx
@@ -17,6 +17,7 @@ import { useFS } from '@/hooks/useFS';
import { useJSRuntime } from '@/hooks/useJSRuntime';
import { useKeepAlive } from '@/hooks/useKeepAlive';
import { GitStatusIndicator } from '@/components/GitStatusIndicator';
+import { StarButton } from '@/components/StarButton';
import { generateSecretKey, getPublicKey, nip19 } from 'nostr-tools';
import { bytesToHex } from 'nostr-tools/utils';
import { buildProject } from "@/lib/build";
@@ -188,6 +189,11 @@ BASE_DOMAIN=nostrdeploy.com`);
// when isAILoading becomes true after user interaction
};
+ const handleProjectDeleted = () => {
+ setProject(null);
+ navigate('/');
+ };
+
if (isLoading) {
return (
@@ -233,16 +239,25 @@ BASE_DOMAIN=nostrdeploy.com`);
-
+
{/* Mobile Sidebar Overlay */}
@@ -395,10 +410,16 @@ BASE_DOMAIN=nostrdeploy.com`);
- {/* Right side - Actions Menu */}
+ {/* Right side - Star and Actions Menu */}