- {Object.entries(Category).map(([catKey, catVal]) => {
+ {categoryChoices.map(catKey => {
return (
-
-
filterCat(catKey, catVal, v)} />
- {title(catVal)}
+
+ filterCat(catKey, v)} />
+ {title(catKey)}
)
})}
{
- library?.map(item => )
+ library?.map(item => )
}
+
+
+
+ {doCreate ? (
) : (<>>)}
);
}
\ No newline at end of file
diff --git a/src/components/TextPrompt.css b/src/components/TextPrompt.css
new file mode 100644
index 0000000..cae6f2f
--- /dev/null
+++ b/src/components/TextPrompt.css
@@ -0,0 +1,6 @@
+.text-prompt {
+ width: 75%;
+ height: 75%;
+ padding: 10pt;
+ margin: 4pt;
+}
\ No newline at end of file
diff --git a/src/components/TextPrompt.tsx b/src/components/TextPrompt.tsx
new file mode 100644
index 0000000..546c5bb
--- /dev/null
+++ b/src/components/TextPrompt.tsx
@@ -0,0 +1,11 @@
+import { TextareaAutosize } from "@material-ui/core";
+import { $textComposition } from "../lib/prompt";
+import "./TextPrompt.css";
+import { useStore } from "@nanostores/react";
+
+export function TextPrompt () {
+ const text = useStore($textComposition);
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/src/index.tsx b/src/index.tsx
index c079c85..032464f 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -3,17 +3,13 @@ import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
-import { Provider } from 'react-redux';
-import store from "./store"
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
-
-
-
+
);
diff --git a/src/lib/ast.ts b/src/lib/ast.ts
index ef62b21..b487ca1 100644
--- a/src/lib/ast.ts
+++ b/src/lib/ast.ts
@@ -1,4 +1,4 @@
-import { randomUUID } from "crypto";
+import { v4 as randomUUID } from "uuid";
import { Op } from "./operator";
import { createSlice } from '@reduxjs/toolkit'
diff --git a/src/lib/prompt.test.ts b/src/lib/prompt.test.ts
index 8397fcd..7dc1b85 100644
--- a/src/lib/prompt.test.ts
+++ b/src/lib/prompt.test.ts
@@ -1,4 +1,4 @@
-import { randomUUID } from "crypto";
+import { v4 as randomUUID } from "uuid";
import { Op } from "./operator";
import {
Library as LibraryType,
diff --git a/src/lib/prompt.tsx b/src/lib/prompt.tsx
index 7c62686..0500e46 100644
--- a/src/lib/prompt.tsx
+++ b/src/lib/prompt.tsx
@@ -1,4 +1,4 @@
-import { randomUUID } from "crypto";
+import { v4 as randomUUID } from "uuid";
import { Op } from "./operator";
import { atom, computed } from "nanostores";
@@ -8,6 +8,7 @@ type IdAble = {
id: Id,
}
+// only vibes and styles will have a name.
export enum Category {
subject = "subject",
style = "style",
@@ -15,6 +16,10 @@ export enum Category {
medium = "medium",
}
+export function categoryHasName(cat : Category) {
+ return (cat === Category.style || cat === Category.vibes)
+}
+
const N_CATEGORIES = Object.keys(Category).length;
export function catI(c: Category | string): number {