diff --git a/src/components/InlineIcon.tsx b/src/components/InlineIcon.tsx new file mode 100644 index 00000000..7d967232 --- /dev/null +++ b/src/components/InlineIcon.tsx @@ -0,0 +1,15 @@ +export const InlineIcon = ({ icon }: { icon: JSX.Element }) => { + return ( + + {icon} + + ); +}; diff --git a/src/components/MagicSettings.tsx b/src/components/MagicSettings.tsx index 2f2dc9ba..190d7b24 100644 --- a/src/components/MagicSettings.tsx +++ b/src/components/MagicSettings.tsx @@ -2,28 +2,14 @@ import { useState } from "react"; import { Dialog } from "./Dialog"; import { TextField } from "./TextField"; import { MagicIcon, OpenAIIcon } from "./icons"; - -import "./MagicSettings.scss"; import { FilledButton } from "./FilledButton"; import { CheckboxItem } from "./CheckboxItem"; import { KEYS } from "../keys"; import { useUIAppState } from "../context/ui-appState"; +import { InlineIcon } from "./InlineIcon"; +import { Paragraph } from "./Paragraph"; -const InlineButton = ({ icon }: { icon: JSX.Element }) => { - return ( - - {icon} - - ); -}; +import "./MagicSettings.scss"; export const MagicSettings = (props: { openAIKey: string | null; @@ -70,18 +56,17 @@ export const MagicSettings = (props: { className="MagicSettings" autofocus={false} > -

- For the diagram-to-code feature we use{" "} - + For the diagram-to-code feature we use OpenAI. -

-

+ + While the OpenAI API is in beta, its use is strictly limited — as such we require you use your own API key. You can create an{" "} . -

-

+ + Your OpenAI key does not leave the browser, and you can also set your own limit in your OpenAI account dashboard if needed. -

+ event.key === KEYS.ENTER && onConfirm()} /> -

+ By default, your API token is not persisted anywhere so you'll need to insert it again after reload. But, you can persist locally in your browser below. -

+ Persist API key in browser storage -

- Once API key is set, you can use the {" "} + + Once API key is set, you can use the {" "} tool to wrap your elements in a frame that will then allow you to turn it into code. This dialog can be accessed using the AI Settings{" "} - . -

+ . + { + return ( +

+ {props.children} +

+ ); +}; diff --git a/src/css/styles.scss b/src/css/styles.scss index 032c9abb..341370f2 100644 --- a/src/css/styles.scss +++ b/src/css/styles.scss @@ -734,4 +734,8 @@ letter-spacing: 0.6px; font-family: "Assistant"; } + + .excalidraw__paragraph { + margin: 1rem 0; + } }