revert: i hate this
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
'use client'
|
||||
|
||||
import Comments from '@/components/Comments'
|
||||
import Image from '@/components/Image'
|
||||
import Link from '@/components/Link'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
@@ -13,7 +12,6 @@ import NextImage from 'next/image'
|
||||
import { CoreContent } from 'pliny/utils/contentlayer'
|
||||
import { formatDate } from 'pliny/utils/formatDate'
|
||||
import { ReactNode, useState } from 'react'
|
||||
import { Redis } from "@upstash/redis"
|
||||
|
||||
interface LayoutProps {
|
||||
content: CoreContent<Blog>
|
||||
@@ -23,13 +21,8 @@ interface LayoutProps {
|
||||
prev?: { path: string; title: string }
|
||||
}
|
||||
|
||||
const redis = Redis.fromEnv()
|
||||
|
||||
export const revalidate = 60
|
||||
|
||||
export default async function PostLayout({ content, authorDetails, next, prev, children }: LayoutProps) {
|
||||
export default function PostLayout({ content, authorDetails, next, prev, children }: LayoutProps) {
|
||||
const { path, slug, tags, date, title, thumbnail } = content
|
||||
const views = (await redis.get<number>(["pageviews", "projects", slug].join(":"))) ?? 0;
|
||||
const displayThumbnail = thumbnail ? thumbnail : '/static/images/twitter-card.png'
|
||||
const [isLoading, setIsLoading] = useState(true)
|
||||
|
||||
@@ -67,14 +60,6 @@ export default async function PostLayout({ content, authorDetails, next, prev, c
|
||||
<time dateTime={date}>
|
||||
{formatDate(date, siteMetadata.locale)}
|
||||
</time>
|
||||
{views > 0 && (
|
||||
<span className="ml-2">
|
||||
<span className="text-primary">
|
||||
{views.toLocaleString()}
|
||||
</span>{" "}
|
||||
views
|
||||
</span>
|
||||
)}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
Reference in New Issue
Block a user