feature: add project name editing functionality

This commit is contained in:
Pulkit Garg
2025-06-25 10:26:29 +05:30
parent 7461b763b1
commit 411a9a5f1c
3 changed files with 133 additions and 7 deletions

View File

@ -7,6 +7,7 @@ interface ProjectStore {
// Actions
createNewProject: (name: string) => void;
closeProject: () => void;
updateProjectName: (name: string) => void;
}
export const useProjectStore = create<ProjectStore>((set) => ({
@ -25,4 +26,16 @@ export const useProjectStore = create<ProjectStore>((set) => ({
closeProject: () => {
set({ activeProject: null });
},
updateProjectName: (name: string) => {
set((state) => ({
activeProject: state.activeProject
? {
...state.activeProject,
name,
updatedAt: new Date(),
}
: null,
}));
},
}));