-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpageBlogSlug
More file actions
197 lines (189 loc) · 5.19 KB
/
Copy pathpageBlogSlug
File metadata and controls
197 lines (189 loc) · 5.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
import Image from "next/image";
import Link from "next/link";
import { GoCard } from "@/components/go-card";
import {
PageHeader,
PageHeaderDescription,
PageHeaderHeading,
} from "@/components/page-header";
import Markdown from "react-markdown";
import { Separator } from "@/components/ui/separator";
import { cn } from "@/lib/utils";
import {
fetchBlogBySlug,
fetchCategories,
fetchPaginationBlog,
fetchPaginationBlogsByCategory,
fetchPaginationTemplatesByCategory,
fetchRelatedBlogByTags,
} from "@/lib/strapi/actions";
import { shuffle } from "lodash";
export async function generateMetadata(props: { params: { locale: string } }) {
return {
title: "Blog",
description: "",
};
}
const Blog = async ({
searchParams,
params,
}: {
searchParams: { [key: string]: string | string[] | undefined };
}) => {
// const filter = searchParams.filter ?? "ALL";
const blog = await fetchBlogBySlug(params.slug);
// console.log(JSON.stringify(blog?.attributes.tags));
const tagIds = blog.attributes.tags.data.map((tag) => tag.id);
// console.log(tagIds);
const relatedBlogs = await fetchRelatedBlogByTags(tagIds);
// console.log(relatedBlogs);
const description = blog.attributes.content;
return (
<div className="container relative">
<div className="flex flex-col xl:flex-row">
<PageHeader className="w-full items-start">
<nav className="mb-6 flex items-center gap-2 text-sm">
<Link
href="/"
className={cn(
"transition-colors hover:text-foreground/80 text-foreground/60"
)}
>
Home
</Link>
<Separator className="mx-2 h-4" orientation="vertical" />
<Link
href="/blogs"
className={cn(
"transition-colors hover:text-foreground/80 text-foreground/60"
)}
>
Blogs
</Link>
<Separator className="mx-2 h-4" orientation="vertical" />
<span>{blog?.attributes.title}</span>
</nav>
<PageHeaderHeading className="max-w-4xl text-left">
{/* Contact closed-won deals using round-robin tasks. */}
{blog?.attributes?.title}
</PageHeaderHeading>
<Image
src={blog?.attributes.thumbnail}
alt="icon"
width={500}
height={100}
className="mx-auto rounded-lg w-full"
/>
<div className="descriptionblock shrink-0 flex gap-20 ">
<div className="markdownformat text-paragraph break-normal">
{/*max-w-4xl */}
<Markdown>{description}</Markdown>
</div>
</div>
</PageHeader>
</div>
<div className="mb-12 mt-20 text-center">
<PageHeaderHeading className="mx-auto max-w-4xl">
Related Blogs
</PageHeaderHeading>
<PageHeaderDescription className="mt-3">
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Iste
repellendus ipsa, pariatur
</PageHeaderDescription>
</div>
<div className="mb-12 grid grid-cols-2 gap-4 xl:grid-cols-4">
{shuffle(relatedBlogs)
.slice(0, 4)
.map((blog) => (
<GoCard
key={blog.id}
link={`/blogs/${blog.attributes.slug}`}
title={blog.attributes.title}
category={blog.attributes.tags as any as ResponseTags}
icon={
<Image
src={blog.attributes.thumbnail}
alt="icon"
width={200}
height={100}
className="rounded-lg mx-auto w-full h-52 object-cover"
/>
}
>
{blog.attributes.content
.replace(/[#`_*~>]/g, "")
.replace(/<u>/g, "")
.replace(/<\/u>/g, "")}
</GoCard>
))}{" "}
{/* <GoCard
}
<GoCard
link="#"
title="Add closed deals to MixMax with AI and Slack"
icon={
<Image
src="/icon-salesforce.png"
alt="icon"
width={200}
height={100}
className="mx-auto rounded-lg"
/>
}
>
Elevate your sales strategy with this AI-powered triage template and
seamlessly integrate with MixMax for timely engagement with won deals.
</GoCard>
{/* <GoCard
link="#"
title="Add closed deals to MixMax with AI and Slack"
icon={
<Image
src="/icon-salesforce.png"
alt="icon"
width={200}
height={100}
className="mx-auto rounded-lg"
/>
}
>
Elevate your sales strategy with this AI-powered triage template and
seamlessly integrate with MixMax for timely engagement with won deals.
</GoCard>
<GoCard
link="#"
title="Add closed deals to MixMax with AI and Slack"
icon={
<Image
src="/icon-salesforce.png"
alt="icon"
width={200}
height={100}
className="mx-auto rounded-lg"
/>
}
>
Elevate your sales strategy with this AI-powered triage template and
seamlessly integrate with MixMax for timely engagement with won deals.
</GoCard>
<GoCard
link="#"
title="Add closed deals to MixMax with AI and Slack"
icon={
<Image
src="/icon-salesforce.png"
alt="icon"
width={200}
height={100}
className="mx-auto rounded-lg"
/>
}
>
Elevate your sales strategy with this AI-powered triage template and
seamlessly integrate with MixMax for timely engagement with won deals.
</GoCard> */}
</div>
</div>
);
};
export default Blog;