Initial commit by AI Generator
This commit is contained in:
12
index.html
Normal file
12
index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>React App</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.jsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
9
package.json
Normal file
9
package.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "pending-requests-app",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"scripts": { "dev": "vite", "build": "vite build" },
|
||||
"dependencies": { "react": "^18.2.0", "react-dom": "^18.2.0" },
|
||||
"devDependencies": { "@vitejs/plugin-react": "^4.2.1", "vite": "^5.1.0" }
|
||||
}
|
||||
26
src/App.jsx
Normal file
26
src/App.jsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { useState } from 'react';
|
||||
export default function App() {
|
||||
const [requests, setReqs] = useState([{id: 1, name: 'Sample Request'}]);
|
||||
const style = {
|
||||
app: { padding: '20px', fontFamily: 'system-ui', maxWidth: '600px', margin: '0 auto' },
|
||||
card: { border: '1px solid #ccc', padding: '15px', marginBottom: '10px', borderRadius: '8px' }
|
||||
};
|
||||
return (
|
||||
<div style={style.app}>
|
||||
<h1>{{ $('Get Pending Requests').first().json.requests[0].app_name }}</h1>
|
||||
<p>{{ $('Get Pending Requests').first().json.requests[0].description }}</p>
|
||||
<div>
|
||||
{requests.map(q => (
|
||||
<div key={q.id} style={style.card}>
|
||||
<span>{q.name}</span>
|
||||
<button ond,ick={() => setReqs(requests.filter(r => r.id !== q.id))}>Done</button>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<footer>
|
||||
<p><strong>Features:</strong> {{ $('Get Pending Requests').first().json.requests[0].features.join(', ') }}</p>
|
||||
<p><strong>Style:</strong> {{ $('Get Pending Requests').first().json.requests[0].style }}</p>
|
||||
</footer>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
9
src/main.jsx
Normal file
9
src/main.jsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import App from './App';
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
||||
3
vite.config.js
Normal file
3
vite.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
export default defineConfig({ plugins: [react()] });
|
||||
Reference in New Issue
Block a user