diff --git a/src/app/(main)/home-bg-video/page.tsx b/src/app/(main)/home-bg-video/page.tsx
index 8ac4840..c7df79b 100644
--- a/src/app/(main)/home-bg-video/page.tsx
+++ b/src/app/(main)/home-bg-video/page.tsx
@@ -1,6 +1,5 @@
"use client";
import Hero from "@/components/Hero";
-import Homepage from "@/components/Homepage";
import dynamic from "next/dynamic";
const ParallaxContainer = dynamic(() => import("@/components/ParallaxContainer"), {
@@ -19,7 +18,6 @@ export default function Home1BGVideoMultiPage() {
>
-
>
);
}
diff --git a/src/app/(main)/page.tsx b/src/app/(main)/page.tsx
index 78e456b..99965dc 100644
--- a/src/app/(main)/page.tsx
+++ b/src/app/(main)/page.tsx
@@ -1,4 +1,7 @@
-import Homepage from "./home-bg-video/page";
+import Blogs from "@/components/Blogs/Blogs";
+import Parallax from "./home-bg-video/page";
+import Homepage from "@/components/Homepage";
+
export const metadata = {
title: "HomePage - Cochise Oncology",
description: "Resonance — One & Multi Page React Nextjs Creative Template",
@@ -25,6 +28,7 @@ export const metadata = {
export default function Home() {
return (
<>
+
>
);
diff --git a/src/components/Blogs/Blog.tsx b/src/components/Blogs/Blog.tsx
index e691462..781779d 100644
--- a/src/components/Blogs/Blog.tsx
+++ b/src/components/Blogs/Blog.tsx
@@ -2,8 +2,13 @@ import { blogs9 } from "@/data/blogs";
import React from "react";
import Image from "next/image";
import Link from "next/link";
+import { fetchBlog } from "@/services/payload/blog";
+import { sanitizeBlogContentIntoStringPreview } from "@/utils/sanitize";
-export default function Blog() {
+export default async function Blog() {
+ const data = await fetchBlog(undefined);
+
+ if (!data?.totalDocs) return <>>;
return (
<>
{/* End Background Shape */}
@@ -33,15 +38,15 @@ export default function Blog() {
{/* Blog Posts Grid */}
{/* Post Item */}
- {blogs9.map((elm: any, i: number) => (
+ {data?.formattedData?.slice(0, 2).map((elm: any, i: number) => (
-
+
@@ -49,24 +54,12 @@ export default function Blog() {
- {elm.title}
+ {elm.title}
-
{elm.intro}
+
{sanitizeBlogContentIntoStringPreview(elm.content)}
diff --git a/src/components/Homepage.tsx b/src/components/Homepage.tsx
index cffbf6e..ac4d043 100644
--- a/src/components/Homepage.tsx
+++ b/src/components/Homepage.tsx
@@ -12,6 +12,7 @@ import TestimonialsDark from "./TestimonialsDark";
import ContactDark from "./ContactDark";
import { features4 } from "@/data/features";
import Cta3 from "./cta3";
+import { fetchBlog } from "@/services/payload/blog";
export default function homepage({ onePage = false, dark = false }) {
return (
@@ -125,26 +126,6 @@ export default function homepage({ onePage = false, dark = false }) {
Get compassionate care and excellent medical services from COCHISE ONCOLOGY in Sierra Vista, Arizona.
-
- {onePage ? (
- <>
- {" "}
-
- Request a quote
-
- >
- ) : (
- <>
- {" "}
-
-
Request a quote
-
- >
- )}
-
{/* End Left Column */}
{/* Right Column */}
diff --git a/src/components/cta3.tsx b/src/components/cta3.tsx
index c36d7ea..07790cc 100644
--- a/src/components/cta3.tsx
+++ b/src/components/cta3.tsx
@@ -4,20 +4,18 @@ import React from "react";
export default function Cta3() {
return (
<>
-
+
{/* Features List Item */}
{features2.map((elm, i) => (
- <>
-
-
-
-
-
-
{elm.text}
-
{elm.desc}
-
+
+
+
- >
+
+
{elm.text}
+
{elm.desc}
+
+
))}
{/* End Features List Item */}
diff --git a/src/services/payload/blog.ts b/src/services/payload/blog.ts
index 6297355..59b34f8 100644
--- a/src/services/payload/blog.ts
+++ b/src/services/payload/blog.ts
@@ -2,7 +2,7 @@ import payloadConfig from "@/payload.config";
import { formatDate } from "@/utils/datetime";
import { getPayload } from "payload";
-export async function fetchBlog(page: number = 1) {
+export async function fetchBlog(page: number | undefined) {
const payload = await getPayload({ config: payloadConfig });
const blogDataQuery = await payload.find({
collection: "blogs",