```javascript import { useState } from 'react' import { supabase } from './supabaseClient' export default function ProjectCard({ project, onUpdate }) { const [isEditing, setIsEditing] = useState(false) const [title, setTitle] = useState(project.title) const [description, setDescription] = useState(project.description) async function deleteProject() { const { error } = await supabase .from('user_projects') .delete() .eq('id', project.id) if (error) alert(error.message) else onUpdate() } async function updateProject() { const { error } = await supabase .from('user_projects') .update({ title, description }) .eq('id', project.id) if (error) alert(error.message) else { onUpdate() setIsEditing(false) } } return (
{isEditing ? (
setTitle(e.target.value)} className="w-full bg-gray-700 rounded-lg px-4 py-2 text-white" />