|
1 | 1 | "use client"; |
2 | 2 |
|
| 3 | +import CodeViewer from "@/components/code-viewer"; |
3 | 4 | import Footer from "@/components/Footer"; |
4 | 5 | import Header from "@/components/Header"; |
5 | 6 | import { useScrollTo } from "@/hooks/use-scroll-to"; |
6 | 7 | import { domain } from "@/utils/domain"; |
7 | | -import * as shadcnComponents from "@/utils/shadcn"; |
8 | | -import { Sandpack } from "@codesandbox/sandpack-react"; |
9 | | -import { dracula as draculaTheme } from "@codesandbox/sandpack-themes"; |
10 | 8 | import { CheckIcon } from "@heroicons/react/16/solid"; |
11 | 9 | import { ArrowLongRightIcon, ChevronDownIcon } from "@heroicons/react/20/solid"; |
12 | 10 | import { ArrowUpOnSquareIcon } from "@heroicons/react/24/outline"; |
@@ -417,120 +415,7 @@ export default function Home() { |
417 | 415 | </div> |
418 | 416 | <div className="relative mt-8 w-full overflow-hidden"> |
419 | 417 | <div className="isolate"> |
420 | | - <Sandpack |
421 | | - theme={draculaTheme} |
422 | | - options={{ |
423 | | - showNavigator: true, |
424 | | - externalResources: [ |
425 | | - "https://unpkg.com/@tailwindcss/ui/dist/tailwind-ui.min.css", |
426 | | - ], |
427 | | - editorHeight: "80vh", |
428 | | - showTabs: false, |
429 | | - }} |
430 | | - files={{ |
431 | | - "App.tsx": generatedCode, |
432 | | - "/lib/utils.ts": shadcnComponents.utils, |
433 | | - "/components/ui/accordion.tsx": shadcnComponents.accordian, |
434 | | - "/components/ui/alert-dialog.tsx": |
435 | | - shadcnComponents.alertDialog, |
436 | | - "/components/ui/alert.tsx": shadcnComponents.alert, |
437 | | - "/components/ui/avatar.tsx": shadcnComponents.avatar, |
438 | | - "/components/ui/badge.tsx": shadcnComponents.badge, |
439 | | - "/components/ui/breadcrumb.tsx": |
440 | | - shadcnComponents.breadcrumb, |
441 | | - "/components/ui/button.tsx": shadcnComponents.button, |
442 | | - "/components/ui/calendar.tsx": shadcnComponents.calendar, |
443 | | - "/components/ui/card.tsx": shadcnComponents.card, |
444 | | - "/components/ui/carousel.tsx": shadcnComponents.carousel, |
445 | | - "/components/ui/checkbox.tsx": shadcnComponents.checkbox, |
446 | | - "/components/ui/collapsible.tsx": |
447 | | - shadcnComponents.collapsible, |
448 | | - "/components/ui/dialog.tsx": shadcnComponents.dialog, |
449 | | - "/components/ui/drawer.tsx": shadcnComponents.drawer, |
450 | | - "/components/ui/dropdown-menu.tsx": |
451 | | - shadcnComponents.dropdownMenu, |
452 | | - "/components/ui/input.tsx": shadcnComponents.input, |
453 | | - "/components/ui/label.tsx": shadcnComponents.label, |
454 | | - "/components/ui/menubar.tsx": shadcnComponents.menuBar, |
455 | | - "/components/ui/navigation-menu.tsx": |
456 | | - shadcnComponents.navigationMenu, |
457 | | - "/components/ui/pagination.tsx": |
458 | | - shadcnComponents.pagination, |
459 | | - "/components/ui/popover.tsx": shadcnComponents.popover, |
460 | | - "/components/ui/progress.tsx": shadcnComponents.progress, |
461 | | - "/components/ui/radio-group.tsx": |
462 | | - shadcnComponents.radioGroup, |
463 | | - "/components/ui/select.tsx": shadcnComponents.select, |
464 | | - "/components/ui/separator.tsx": shadcnComponents.separator, |
465 | | - "/components/ui/skeleton.tsx": shadcnComponents.skeleton, |
466 | | - "/components/ui/slider.tsx": shadcnComponents.slider, |
467 | | - "/components/ui/switch.tsx": |
468 | | - shadcnComponents.switchComponent, |
469 | | - "/components/ui/table.tsx": shadcnComponents.table, |
470 | | - "/components/ui/tabs.tsx": shadcnComponents.tabs, |
471 | | - "/components/ui/textarea.tsx": shadcnComponents.textarea, |
472 | | - "/components/ui/toast.tsx": shadcnComponents.toast, |
473 | | - "/components/ui/toaster.tsx": shadcnComponents.toaster, |
474 | | - "/components/ui/toggle-group.tsx": |
475 | | - shadcnComponents.toggleGroup, |
476 | | - "/components/ui/toggle.tsx": shadcnComponents.toggle, |
477 | | - "/components/ui/tooltip.tsx": shadcnComponents.tooltip, |
478 | | - "/components/ui/use-toast.tsx": shadcnComponents.useToast, |
479 | | - "/public/index.html": `<!DOCTYPE html> |
480 | | - <html lang="en"> |
481 | | - <head> |
482 | | - <meta charset="UTF-8"> |
483 | | - <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
484 | | - <title>Document</title> |
485 | | - <script src="https://cdn.tailwindcss.com"></script> |
486 | | - </head> |
487 | | - <body> |
488 | | - <div id="root"></div> |
489 | | - </body> |
490 | | - </html>`, |
491 | | - }} |
492 | | - template="react-ts" |
493 | | - customSetup={{ |
494 | | - dependencies: { |
495 | | - "lucide-react": "latest", |
496 | | - recharts: "2.9.0", |
497 | | - "react-router-dom": "latest", |
498 | | - "@radix-ui/react-accordion": "^1.2.0", |
499 | | - "@radix-ui/react-alert-dialog": "^1.1.1", |
500 | | - "@radix-ui/react-aspect-ratio": "^1.1.0", |
501 | | - "@radix-ui/react-avatar": "^1.1.0", |
502 | | - "@radix-ui/react-checkbox": "^1.1.1", |
503 | | - "@radix-ui/react-collapsible": "^1.1.0", |
504 | | - "@radix-ui/react-dialog": "^1.1.1", |
505 | | - "@radix-ui/react-dropdown-menu": "^2.1.1", |
506 | | - "@radix-ui/react-hover-card": "^1.1.1", |
507 | | - "@radix-ui/react-label": "^2.1.0", |
508 | | - "@radix-ui/react-menubar": "^1.1.1", |
509 | | - "@radix-ui/react-navigation-menu": "^1.2.0", |
510 | | - "@radix-ui/react-popover": "^1.1.1", |
511 | | - "@radix-ui/react-progress": "^1.1.0", |
512 | | - "@radix-ui/react-radio-group": "^1.2.0", |
513 | | - "@radix-ui/react-select": "^2.1.1", |
514 | | - "@radix-ui/react-separator": "^1.1.0", |
515 | | - "@radix-ui/react-slider": "^1.2.0", |
516 | | - "@radix-ui/react-slot": "^1.1.0", |
517 | | - "@radix-ui/react-switch": "^1.1.0", |
518 | | - "@radix-ui/react-tabs": "^1.1.0", |
519 | | - "@radix-ui/react-toast": "^1.2.1", |
520 | | - "@radix-ui/react-toggle": "^1.1.0", |
521 | | - "@radix-ui/react-toggle-group": "^1.1.0", |
522 | | - "@radix-ui/react-tooltip": "^1.1.2", |
523 | | - "class-variance-authority": "^0.7.0", |
524 | | - clsx: "^2.1.1", |
525 | | - "date-fns": "^3.6.0", |
526 | | - "embla-carousel-react": "^8.1.8", |
527 | | - "react-day-picker": "^8.10.1", |
528 | | - "tailwind-merge": "^2.4.0", |
529 | | - "tailwindcss-animate": "^1.0.7", |
530 | | - vaul: "^0.9.1", |
531 | | - }, |
532 | | - }} |
533 | | - /> |
| 418 | + <CodeViewer code={generatedCode} showEditor /> |
534 | 419 | </div> |
535 | 420 |
|
536 | 421 | <AnimatePresence> |
|
0 commit comments