mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-17 19:32:47 +03:00
cf376fb59f
* feat: add brain management button * feat: add brains list * feat: add brain search bar * feat: sort brain list by name * refactor: update brains management page structure * feat(BrainManagement): add new brain button * feat: update import links
13 lines
385 B
TypeScript
13 lines
385 B
TypeScript
import { MinimalBrainForUser } from "@/lib/context/BrainProvider/types";
|
|
|
|
export const sortBrainsByName = (
|
|
minimalBrains: MinimalBrainForUser[]
|
|
): MinimalBrainForUser[] => {
|
|
// Use the sort method to sort the array by the 'name' property
|
|
const sortedMinimalBrains = minimalBrains
|
|
.slice()
|
|
.sort((a, b) => a.name.localeCompare(b.name));
|
|
|
|
return sortedMinimalBrains;
|
|
};
|