GeezerVison is showing github.com — Commit from Bolt to GitHub · aidrivencoder/master-git-github@53afac4
File treeExpand file treeCollapse file tree Open diff view settings home/project/src/app/tutorials/[id]
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .gitignore +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -41,5 +41,4 @@ next-env.d.ts | 41 | 41 | .vscode/ | 42 | 42 |
| 43 | 43 | # Project specific | 44 | | -bolt_synced/ | 45 | | -project-bolt-*.zip | | 44 | +bolt_synced/ |
Collapse file Copy file name to clipboard +54Lines changed: 54 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +'use client' | | 2 | + | | 3 | +import { useEffect, useState } from 'react' | | 4 | +import { TutorialPage as ClientTutorialPage } from '@/components/tutorials/TutorialPage' | | 5 | +import { getTutorialById } from '@/lib/firebase/services/tutorials' | | 6 | +import { LoadingSpinner } from '@/components/ui/LoadingSpinner' | | 7 | + | | 8 | +interface TutorialPageProps { | | 9 | + params: { id: string } | | 10 | +} | | 11 | + | | 12 | +export default function TutorialPage({ params }: TutorialPageProps) { | | 13 | + const [tutorial, setTutorial] = useState(null) | | 14 | + const [loading, setLoading] = useState(true) | | 15 | + const [error, setError] = useState(null) | | 16 | + | | 17 | + useEffect(() => { | | 18 | + async function fetchTutorial() { | | 19 | + try { | | 20 | + const fetchedTutorial = await getTutorialById(params.id) | | 21 | + setTutorial(fetchedTutorial) | | 22 | + } catch (err) { | | 23 | + setError('Failed to load tutorial') | | 24 | + console.error('Error fetching tutorial:', err) | | 25 | + } finally { | | 26 | + setLoading(false) | | 27 | + } | | 28 | + } | | 29 | + | | 30 | + fetchTutorial() | | 31 | + }, [params.id]) | | 32 | + | | 33 | + if (loading) { | | 34 | + return ( | | 35 | + <div className="min-h-screen flex items-center justify-center"> | | 36 | + <LoadingSpinner size="lg" /> | | 37 | + </div> | | 38 | + ) | | 39 | + } | | 40 | + | | 41 | + if (error) { | | 42 | + return ( | | 43 | + <div className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8"> | | 44 | + <div className="px-4 py-6 sm:px-0"> | | 45 | + <div className="text-center"> | | 46 | + <p className="text-red-600 dark:text-red-400">{error}</p> | | 47 | + </div> | | 48 | + </div> | | 49 | + </div> | | 50 | + ) | | 51 | + } | | 52 | + | | 53 | + return <ClientTutorialPage tutorial={tutorial} /> | | 54 | +} |
Collapse file Copy file name to clipboardExpand all lines: next.config.js +18-1Lines changed: 18 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | /** @type {import('next').NextConfig} */ | 2 | 2 | const nextConfig = { | 3 | 3 | reactStrictMode: true, | | 4 | + swcMinify: true, | 4 | 5 | images: { | 5 | 6 | domains: ['github.com', 'avatars.githubusercontent.com'], | 6 | 7 | }, | | 8 | + experimental: { | | 9 | + optimizeCss: true, | | 10 | + turbo: { | | 11 | + rules: { | | 12 | + '*.md': ['raw-loader'] | | 13 | + } | | 14 | + }, | | 15 | + }, | 7 | 16 | webpack: (config) => { | | 17 | + // Add cache configuration | | 18 | + config.cache = { | | 19 | + type: 'filesystem', | | 20 | + buildDependencies: { | | 21 | + config: [__filename], | | 22 | + } | | 23 | + } | | 24 | + | 8 | 25 | config.module.rules.push({ | 9 | 26 | test: /\.js$/, | 10 | 27 | include: /node_modules\/undici/, | @@ -15,7 +32,7 @@ const nextConfig = { | 15 | 32 | plugins: ['@babel/plugin-proposal-private-methods', '@babel/plugin-proposal-class-properties'] | 16 | 33 | } | 17 | 34 | } | 18 | | - }); | | 35 | + }) | 19 | 36 | return config; | 20 | 37 | } | 21 | 38 | } | |
|