can't figure out shared state issue--the updated composition won't show on the composer. moving on to dnd for promptitem orders and promptitem hiding.

This commit is contained in:
Jordan
2024-03-02 06:36:38 -08:00
parent 326f3788fa
commit bef7b8e2cf
19 changed files with 285 additions and 125 deletions

View File

@ -57,7 +57,7 @@ export function itemIsNugget(item: PromptItem): boolean {
export type Composition = Array<PromptItem>;
export const $library = atom<Library>([])
export const $library = atom<Library>([]);
export function addItemToLibrary(item: LibraryItem) {
$library.set([

12
src/lib/util.tsx Normal file
View File

@ -0,0 +1,12 @@
export function title(text: string) {
return (!text.length) ? "" : ((text.length === 1) ? text.toUpperCase() : text[0].toUpperCase() + text.substring(1).toLowerCase());
}
/**
*
* @param arr Array to filter
* @param item item in the array to toggle.
*/
export function arrayToggle(arr : Array<any>, item : any) {
}