From b839b9b5cd8b11391d6fede726f76bb75d9b5eb3 Mon Sep 17 00:00:00 2001 From: caileighsmith <62355730+caileighsmith@users.noreply.github.com> Date: Thu, 27 Feb 2025 23:03:49 +0000 Subject: [PATCH 1/2] Testing using Preact --- client/.gitignore | 24 + client/README.md | 15 + client/index.html | 14 + client/jsconfig.json | 20 + client/package-lock.json | 1860 ++++++++++++++++++++++++++++++++++ client/package.json | 16 + client/public/vite.svg | 15 + client/src/assets/preact.svg | 6 + client/src/index.jsx | 174 ++++ client/src/style.css | 78 ++ client/vite.config.js | 7 + 11 files changed, 2229 insertions(+) create mode 100644 client/.gitignore create mode 100644 client/README.md create mode 100644 client/index.html create mode 100644 client/jsconfig.json create mode 100644 client/package-lock.json create mode 100644 client/package.json create mode 100644 client/public/vite.svg create mode 100644 client/src/assets/preact.svg create mode 100644 client/src/index.jsx create mode 100644 client/src/style.css create mode 100644 client/vite.config.js diff --git a/client/.gitignore b/client/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/client/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/client/README.md b/client/README.md new file mode 100644 index 0000000..998688d --- /dev/null +++ b/client/README.md @@ -0,0 +1,15 @@ +# `create-preact` + +
{props.description}
+ + ); +} + +function ApiData({ endpoint, title }) { + const [data, setData] = useState(null); + + const fetchData = () => { + fetch(`https://web-production-aae7.up.railway.app${endpoint}`) + .then(response => response.json()) + .then(data => setData(data)) + .catch(error => console.error('Error fetching data:', error)); + }; + + return ( +{JSON.stringify(data, null, 2)}
+ ) : (
+ Click the button to load data
+ )} +{JSON.stringify(data, null, 2)}
+ ) : (
+ Enter a query and click the button to search
+ )} +{JSON.stringify(data, null, 2)}
+ ) : (
+ Enter a prompt and click the button to submit
+ )} +{JSON.stringify(data, null, 2)}
+ ) : (
+ Enter a Mitzvah ID and click the button to explain
+ )} +{JSON.stringify(data, null, 2)}
) : (