From ccd3b2299482659aeeafb39fb3505cb4cd0a6103 Mon Sep 17 00:00:00 2001 From: kudinDmitriyUp Date: Thu, 25 Jun 2026 08:10:13 +0000 Subject: [PATCH] Bob AI: Add service detail pages (dynamic route /services/:slug) --- src/App.tsx | 2 ++ src/data/services.ts | 19 +++++++++++++++++++ src/pages/NutritionPage.tsx | 6 +++++- src/pages/ServiceDetailPage.tsx | 30 ++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 src/data/services.ts create mode 100644 src/pages/ServiceDetailPage.tsx diff --git a/src/App.tsx b/src/App.tsx index 49ac79d..1351757 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,6 +3,7 @@ import Layout from './components/Layout'; import HomePage from './pages/HomePage'; import NutritionPage from "@/pages/NutritionPage"; +import ServiceDetailPage from './pages/ServiceDetailPage'; export default function App() { return ( @@ -10,6 +11,7 @@ export default function App() { } /> } /> + } /> ); } diff --git a/src/data/services.ts b/src/data/services.ts new file mode 100644 index 0000000..f0fa2d3 --- /dev/null +++ b/src/data/services.ts @@ -0,0 +1,19 @@ +export interface Service { + slug: string; + question: string; + answer: string; + body: string; + specs: Array<{ label: string; value: string }>; +} + +export const services: Service[] = [ + {"slug":"item-sc0cq","question":"Do I need to count calories to lose weight?","answer":"Not necessarily. While a caloric deficit is required for weight loss, focusing on nutrient-dense foods and portion control can be just as effective without the stress of tracking.","body":"Transform your outdoor space into a breathtaking extension of your home with our bespoke landscape design services. Our team of expert horticulturists and spatial designers works closely with you to understand your aesthetic preferences, lifestyle needs, and the unique microclimate of your property. We believe every garden should tell a story, blending natural beauty with functional elegance.\n\nFrom the initial conceptual sketches to the final 3D renderings, we ensure every detail is meticulously planned. We carefully select native plantings, drought-resistant flora, and mature trees that will thrive in your specific soil conditions while providing year-round visual interest. The result is a cohesive, sustainable, and stunning outdoor sanctuary.","specs":[{"label":"Consultation","value":"Free 1-hour site visit"},{"label":"Deliverables","value":"2D plans and 3D renderings"},{"label":"Timeline","value":"2-4 weeks"},{"label":"Revisions","value":"Up to 3 rounds"}]}, + {"slug":"item-49l50","question":"What should I eat before a workout?","answer":"Aim for a mix of easily digestible carbohydrates and a moderate amount of protein about 1-2 hours before exercising to fuel your session and prevent fatigue.","body":"Anchor your outdoor living area with durable, beautifully crafted hardscape elements. Whether you envision a sprawling natural stone patio for summer entertaining, a cozy fire pit for crisp autumn evenings, or elegant retaining walls to tame a sloping yard, our master masons bring your vision to life. We use only premium materials sourced from trusted quarries to ensure longevity and timeless appeal.\n\nOur construction process prioritizes structural integrity and proper drainage, ensuring your new hardscape withstands the test of time and weather. We handle all necessary permits and site preparation, minimizing disruption to your daily life. Every paver is laid with precision, creating seamless transitions between your home's interior and your new outdoor oasis.","specs":[{"label":"Materials","value":"Natural stone, brick, concrete pavers"},{"label":"Warranty","value":"10-year structural guarantee"},{"label":"Permitting","value":"Handled by our team"},{"label":"Project Duration","value":"1-3 weeks"}]}, + {"slug":"item-ggn6m","question":"Are carbohydrates bad for me?","answer":"Absolutely not. Carbohydrates are your body's primary energy source. Focus on complex carbs like whole grains, fruits, and vegetables rather than refined sugars.","body":"Protect your landscaping investment and conserve water with our state-of-the-art irrigation solutions. We design and install smart sprinkler and drip systems tailored to the specific hydration needs of your lawn, garden beds, and potted plants. By delivering the exact amount of water directly to the root zones, we promote deeper root growth and healthier, more resilient plants.\n\nModern irrigation is all about efficiency and convenience. We integrate smart controllers that automatically adjust watering schedules based on real-time local weather data and soil moisture sensors. You can easily monitor and control your entire system from your smartphone, ensuring your landscape remains lush and vibrant even when you are miles away from home.","specs":[{"label":"System Type","value":"Smart drip and sprinkler hybrid"},{"label":"Control","value":"Wi-Fi enabled mobile app"},{"label":"Water Savings","value":"Up to 40% annually"},{"label":"Maintenance","value":"Bi-annual seasonal checkups"}]}, + {"slug":"item-wsnb3","question":"How much water should I drink daily?","answer":"A general rule is to drink at least 8 glasses a day, but your needs increase with physical activity and heat. Listen to your body and drink when thirsty.","body":"Extend the usability of your outdoor spaces well into the night with our custom architectural and landscape lighting. Proper illumination enhances the safety and security of your property while dramatically highlighting the architectural features of your home and the most beautiful elements of your garden. We use low-voltage, energy-efficient LED fixtures that cast a warm, inviting glow.\n\nOur lighting designers carefully map out focal points, pathways, and gathering areas to create a layered lighting effect. From subtle moonlighting cascading down from mature trees to precise uplighting on textured stone walls, we craft an enchanting nighttime atmosphere. All wiring is discreetly buried, leaving nothing but the stunning visual impact of the light itself.","specs":[{"label":"Bulb Type","value":"Low-voltage LED"},{"label":"Lifespan","value":"50,000+ hours"},{"label":"Automation","value":"Dusk-to-dawn timers"},{"label":"Style Options","value":"Brass, copper, and matte black"}]}, + {"slug":"item-2cbar","question":"Can I build muscle on a plant-based diet?","answer":"Yes! Plant-based diets can provide ample protein through sources like lentils, beans, tofu, and quinoa. Proper planning ensures you get all essential amino acids.","body":"Keep your property looking immaculate year-round with our comprehensive seasonal maintenance packages. We go far beyond basic mowing, offering a holistic approach to turf and plant health. Our experienced crews provide precise edging, seasonal pruning, core aeration, and organic fertilization to ensure your landscape remains healthy, vibrant, and weed-free through every changing season.\n\nWe understand that a truly beautiful lawn requires proactive care. Our specialists conduct regular soil testing to adjust nutrient applications and monitor for early signs of pests or disease. By tailoring our maintenance schedule to the specific needs of your property and the local climate, we take the guesswork and labor out of yard work, leaving you with nothing to do but enjoy the view.","specs":[{"label":"Frequency","value":"Weekly or bi-weekly"},{"label":"Services","value":"Mowing, edging, pruning, cleanup"},{"label":"Fertilization","value":"100% organic options available"},{"label":"Contract Length","value":"6 or 12-month plans"}]}, +]; + +export function findService(slug: string): Service | undefined { + return services.find((x) => x.slug === slug); +} diff --git a/src/pages/NutritionPage.tsx b/src/pages/NutritionPage.tsx index 107f74c..0bea178 100644 --- a/src/pages/NutritionPage.tsx +++ b/src/pages/NutritionPage.tsx @@ -1,3 +1,4 @@ +import { useNavigate } from 'react-router-dom'; import Button from "@/components/ui/Button"; import HeroBackgroundSlot from "@/components/ui/HeroBackgroundSlot"; import TextAnimation from "@/components/ui/TextAnimation"; @@ -5,8 +6,11 @@ import ImageOrVideo from "@/components/ui/ImageOrVideo"; import ScrollReveal from "@/components/ui/ScrollReveal"; import GridOrCarousel from "@/components/ui/GridOrCarousel"; import FaqSimple from "@/components/sections/faq/FaqSimple"; +import { services } from '@/data/services'; export default function NutritionPage() { + const navigate = useNavigate(); + return ( <>

Personalized Nutrition

@@ -20,7 +24,7 @@ export default function NutritionPage() { description="Find answers to the most frequently asked questions about personalized nutrition, meal planning, and fueling your body." primaryButton={{"text":"Get a Custom Plan","href":"#nutrition-plans"}} secondaryButton={{"text":"Contact a Coach","href":"/contact"}} - items={[{"question":"Do I need to count calories to lose weight?","answer":"Not necessarily. While a caloric deficit is required for weight loss, focusing on nutrient-dense foods and portion control can be just as effective without the stress of tracking."},{"question":"What should I eat before a workout?","answer":"Aim for a mix of easily digestible carbohydrates and a moderate amount of protein about 1-2 hours before exercising to fuel your session and prevent fatigue."},{"question":"Are carbohydrates bad for me?","answer":"Absolutely not. Carbohydrates are your body's primary energy source. Focus on complex carbs like whole grains, fruits, and vegetables rather than refined sugars."},{"question":"How much water should I drink daily?","answer":"A general rule is to drink at least 8 glasses a day, but your needs increase with physical activity and heat. Listen to your body and drink when thirsty."},{"question":"Can I build muscle on a plant-based diet?","answer":"Yes! Plant-based diets can provide ample protein through sources like lentils, beans, tofu, and quinoa. Proper planning ensures you get all essential amino acids."}]} + items={services.map((p) => ({ ...p, onClick: () => navigate(`/services/${p.slug}`) }))} /> ); diff --git a/src/pages/ServiceDetailPage.tsx b/src/pages/ServiceDetailPage.tsx new file mode 100644 index 0000000..c942a24 --- /dev/null +++ b/src/pages/ServiceDetailPage.tsx @@ -0,0 +1,30 @@ +import { useParams, Link, Navigate } from 'react-router-dom'; +import { findService } from '@/data/services'; + +export default function ServiceDetailPage() { + const { slug } = useParams<{ slug: string }>(); + const service = slug ? findService(slug) : undefined; + if (!service) return ; + + return ( +
+
+
+ ← Back to Services +
+

{service.question}

+ {service.body &&
{service.body}
} +
+
+ {service.answer != null && (
Answer{String(service.answer)}
)} +
+ {Array.isArray(service.specs) && service.specs.length > 0 && ( +
+ {service.specs.map((s, i) => (
{s.label}{s.value}
))} +
+ )} +
+
+
+ ); +} -- 2.49.1