You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/(main)/actions.ts
+5-114Lines changed: 5 additions & 114 deletions
Original file line number
Diff line number
Diff line change
@@ -268,123 +268,14 @@ function getSystemPrompt(shadcn: boolean, mostSimilarExample: string) {
268
268
269
269
Explain your work. The first codefence should be the main React component. It should also use "tsx" as the language, and be followed by a sensible filename for the code (please use kebab-case for file names). Use this format: \`\`\`tsx{filename=calculator.tsx}.
270
270
271
-
Here's an example of a good response:
272
-
273
-
"I'll create a calculator app using React. This calculator will support basic arithmetic operations: addition, subtraction, multiplication, and division. Let's break it down into components and implement the functionality.
274
-
275
-
\`\`\`tsx{filename=calculator.tsx}
276
-
import { useState } from 'react'
277
-
import { Button } from "/components/ui/button"
278
-
import { Card, CardContent, CardHeader, CardTitle } from "/components/ui/card"
This calculator component provides a simple and functional interface for basic arithmetic operations. Here's a breakdown of its features:
273
+
Prompt:
274
+
${examples["calculator app"].prompt}
379
275
380
-
1. Display: Shows the current input or result.
381
-
2. Digit buttons: Allow users to input numbers.
382
-
3. Operation buttons: +, -, *, and / for basic arithmetic operations.
383
-
4. Clear button (C): Resets the calculator.
384
-
5. Decimal point button: Allows input of decimal numbers.
385
-
6. Equals button (=): Performs the calculation.
276
+
Response:
277
+
${examples["calculator app"].response}
386
278
387
-
The component uses React's useState hook to manage the state of the display, operands, and current operation. The logic handles both immediate execution of operations and chaining of multiple operations."
Copy file name to clipboardExpand all lines: lib/shadcn-examples.ts
+120Lines changed: 120 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -317,4 +317,124 @@ export default function Blog() {
317
317
}
318
318
`,
319
319
},
320
+
"calculator app": {
321
+
prompt: "make me a calculator app",
322
+
response: `
323
+
I'll create a calculator app using React. This calculator will support basic arithmetic operations: addition, subtraction, multiplication, and division. Let's break it down into components and implement the functionality.
324
+
325
+
\`\`\`tsx{filename=calculator.tsx}
326
+
import { useState } from 'react'
327
+
import { Button } from "/components/ui/button"
328
+
import { Card, CardContent, CardHeader, CardTitle } from "/components/ui/card"
This calculator component provides a simple and functional interface for basic arithmetic operations. Here's a breakdown of its features:
429
+
430
+
1. Display: Shows the current input or result.
431
+
2. Digit buttons: Allow users to input numbers.
432
+
3. Operation buttons: +, -, *, and / for basic arithmetic operations.
433
+
4. Clear button (C): Resets the calculator.
434
+
5. Decimal point button: Allows input of decimal numbers.
435
+
6. Equals button (=): Performs the calculation.
436
+
437
+
The component uses React's useState hook to manage the state of the display, operands, and current operation. The logic handles both immediate execution of operations and chaining of multiple operations."
0 commit comments