settled on typings. Now working on ui interaction flow.

This commit is contained in:
Jordan Hewitt
2024-02-24 10:59:26 -08:00
parent 5d7c53dd3c
commit 50bd3eaf5c
10 changed files with 328 additions and 18815 deletions

View File

@ -1,42 +1,36 @@
import { Dialog, DialogTitle, List, ListItem, ListItemAvatar, Avatar, ListItemText } from "@material-ui/core";
import { blue } from "@material-ui/core/colors";
import ListItemButton from "@mui/material/ListItemButton";
export type Category = {
id: string,
label: string,
color?: string,
}
const categories = [
{ id: "style", label: "Styles", color: "blue" },
{ id: "subject", label: "Subjects", color: "black" },
{ id: "vibes", label: "Vibes", color: "gold" },
{ id: "mediums", label: "Mediums", color: "black" },
] as Category[];
import { Dialog, DialogTitle } from "@material-ui/core";
import { Composable } from "./IComposable";
import { Library as PromptLibraryType, LibraryItem as LibItemType } from "../lib/prompt";
import { LibraryItem } from "./LibraryItem";
export interface SimpleDialogProps {
open: boolean;
selectedValue: string;
onClose: (value: string) => void;
onClose: (composable: Composable) => void,
library: PromptLibraryType,
onAddItem : (item : LibItemType) => void,
}
export function PromptLibrary(props: SimpleDialogProps) {
const { onClose, selectedValue, open } = props;
const { onClose, library, open, onAddItem } = props;
const handleClose = () => {
onClose(selectedValue);
// onClose(selectedValue);
};
const handleNuggetClick = (value: string) => {
onClose(value);
const handleNuggetClick = (composable : Composable) => {
onClose(composable);
};
const handleOnAddItem = (item : LibItemType) => {
}
return (
<Dialog onClose={handleClose} open={open}>
<DialogTitle>Prompt Library</DialogTitle>
<div>
Prompt Library
{
library.map(item => <LibraryItem item={item} onAddItem={handleOnAddItem} />)
}
</div>
</Dialog>
);