Refactor: move sort-by-name to addNewVariableButton folder

This commit is contained in:
igorrCarvalho 2024-05-21 20:30:10 -03:00
commit e2ca4b79f8
3 changed files with 4 additions and 10 deletions

View file

@ -5,13 +5,13 @@ import useAlertStore from "../../stores/alertStore";
import { useGlobalVariablesStore } from "../../stores/globalVariablesStore/globalVariables";
import { useTypesStore } from "../../stores/typesStore";
import { ResponseErrorDetailAPI } from "../../types/api";
import { sortByName } from "../../utils/utils";
import ForwardedIconComponent from "../genericIconComponent";
import InputComponent from "../inputComponent";
import { Button } from "../ui/button";
import { Input } from "../ui/input";
import { Label } from "../ui/label";
import { Textarea } from "../ui/textarea";
import sortByName from "./utils/sort-by-name";
//TODO IMPLEMENT FORM LOGIC

View file

@ -0,0 +1,3 @@
export default function sortByName(stringList: string[]): string[] {
return stringList.sort((a, b) => a.localeCompare(b));
}

View file

@ -1,21 +1,16 @@
import clsx, { ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
import { priorityFields } from "../constants/constants";
import { ADJECTIVES, DESCRIPTIONS, NOUNS } from "../flow_constants";
import {
APIDataType,
APITemplateType,
TemplateVariableType,
} from "../types/api";
import {
IVarHighlightType,
groupedObjType,
nodeGroupedObjType,
tweakType,
} from "../types/components";
import { NodeType } from "../types/flow";
import { FlowState } from "../types/tabs";
import { getRandomElement } from "./reactflowUtils";
export function classNames(...classes: Array<string>): string {
return classes.filter(Boolean).join(" ");
@ -350,7 +345,3 @@ export function freezeObject(obj: any) {
if (!obj) return obj;
return JSON.parse(JSON.stringify(obj));
}
export function sortByName(stringList: string[]): string[] {
return stringList.sort((a, b) => a.localeCompare(b));
}