import React, { useState } from "react";
import { Card, CardContent } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { Home, Phone } from "lucide-react";
import { motion } from "framer-motion";
export default function BlogPage() {
const [selectedPost, setSelectedPost] = useState(null);
return (
{!selectedPost ? (
<>
{/* Header */}
RepairHome.sg Blog
Your trusted handyman service in Singapore – tips, guides, and expert advice
{/* Blog Grid */}
{post.title}
{post.excerpt}
))}
>
) : (
/* Full Article Page */
{selectedPost.title}
{selectedPost.content}
{/* CTA */}
)}
{/* Footer CTA */}
{!selectedPost && (
Need a Reliable Handyman?
From plumbing and electrical fixes to furniture assembly,
RepairHome.sg has you covered.
)}
);
}
/* Example Blog Data (Replace with CMS later) */
const blogPosts = [
{
title: "5 Common Home Repairs You Shouldn't Ignore",
excerpt:
"Small issues like leaking taps or faulty switches can turn into costly repairs...",
content:
"Leaking taps, faulty wiring, and cracked tiles are common issues in Singapore homes. Ignoring them can lead to higher repair costs.\n\nIt's always better to fix small problems early with a professional handyman service.",
},
{
title: "DIY vs Hiring a Handyman: What’s Worth It?",
excerpt:
"While DIY can save money, some jobs require professional expertise...",
content:
"DIY is great for minor fixes, but electrical and plumbing jobs should be handled by professionals to avoid safety risks and long-term damage.",
},
{
title: "How to Maintain Your Home in Singapore’s Climate",
excerpt:
"Humidity and heat can damage fixtures—learn how to protect your home...",
content:
"Singapore’s humid climate can cause mold, rust, and wood warping. Regular maintenance and proper ventilation help protect your home.",
},
];
/* Test Cases
1. Page loads without crashing (no Helmet dependency issues)
2. Blog list renders correctly
3. Clicking 'Read More' opens article
4. Clicking 'Back to Blog' returns to list
5. WhatsApp links open in new tab
6. No console errors on render
*/

