Finalize schema and add deployment workflow

This commit is contained in:
dyzulk
2026-01-16 17:42:45 +07:00
parent 1ffdc7ea5f
commit 1e1222be1f
23 changed files with 2931 additions and 25 deletions

View File

@@ -0,0 +1,56 @@
import { useEffect, useState } from 'react'
import { supabase } from '@/lib/supabase'
import { ProjectCard } from '@/components/ui/project-card'
import { Loader2 } from 'lucide-react'
export default function Projects() {
const [projects, setProjects] = useState<any[]>([])
const [loading, setLoading] = useState(true)
useEffect(() => {
fetchProjects()
}, [])
const fetchProjects = async () => {
const { data, error } = await supabase
.from('projects')
.select('*')
.order('created_at', { ascending: false })
if (!error && data) {
setProjects(data)
}
setLoading(false)
}
if (loading) {
return (
<div className="flex items-center justify-center min-h-[50vh]">
<Loader2 className="animate-spin text-blue-500" size={32} />
</div>
)
}
return (
<div className="container mx-auto px-4 py-12">
<div className="text-center mb-12">
<h1 className="text-4xl font-bold mb-4">My Portfolio</h1>
<p className="text-slate-600 dark:text-slate-400 max-w-2xl mx-auto">
Showcase of my detailed projects and technical case studies.
</p>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{projects.map((project) => (
<ProjectCard key={project.id} project={project} />
))}
</div>
{projects.length === 0 && (
<div className="text-center text-slate-500 py-12">
No projects found yet.
</div>
)}
</div>
)
}