updated(builder-page): added collapsible feature for each section

This commit is contained in:
abhas20
2025-10-24 18:38:52 +05:30
parent 6fcb7a4845
commit 4c0cc947a2
3 changed files with 162 additions and 88 deletions

View File

@ -23,6 +23,10 @@ type ResumeStore = {
// Custom Section Actions
addSection: () => void;
removeSection: (sectionId: SectionKey) => void;
collapsedSections: Record<string, boolean>;
toggleSectionCollapsed: (id: string) => void;
setSectionCollapsed: (id: string, collapsed: boolean) => void;
};
export const useResumeStore = create<ResumeStore>()(
@ -69,6 +73,19 @@ export const useResumeStore = create<ResumeStore>()(
});
}
},
collapsedSections: {},
toggleSectionCollapsed: (id) => {
set((state) => {
state.collapsedSections[id] = !state.collapsedSections[id];
});
},
setSectionCollapsed: (id, collapsed) => {
set((state) => {
state.collapsedSections[id] = collapsed;
});
},
})),
{
limit: 100,