Sort workspaces, envs, jars

This commit is contained in:
Gregory Schier
2025-01-02 08:33:04 -08:00
parent 5ebf7dc499
commit 0dd09062e3
3 changed files with 15 additions and 3 deletions

View File

@@ -5,6 +5,10 @@ import { listWorkspaces } from '../lib/store';
const workspaces = await listWorkspaces();
export const workspacesAtom = atom<Workspace[]>(workspaces);
export const sortedWorkspacesAtom = atom((get) =>
get(workspacesAtom).sort((a, b) => a.name.localeCompare(b.name)),
);
export function useWorkspaces() {
return useAtomValue(workspacesAtom);
return useAtomValue(sortedWorkspacesAtom);
}