standalone is not ready yet
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
30
app/blog/posts.tsx
Normal file
30
app/blog/posts.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { getPosts } from '@/lib/getPosts';
|
||||
import { cookies } from 'next/headers';
|
||||
import { use } from 'react';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
|
||||
export default function Posts() {
|
||||
const c = cookies();
|
||||
|
||||
const posts = use(getPosts());
|
||||
|
||||
return (
|
||||
<>
|
||||
{posts.map((p) => (
|
||||
<div className="space-y-2 rounded-md border border-solid border-gray-700 p-4 text-white">
|
||||
<p className="font-bold">@{p.author.name}</p>
|
||||
<p className="italic">{p.title}</p>
|
||||
<div className="markdown">
|
||||
{p.message && (
|
||||
<ReactMarkdown children={p.message} remarkPlugins={[remarkGfm]} />
|
||||
)}
|
||||
</div>
|
||||
<small className="mt-2">
|
||||
{new Date(p.time * 1000).toLocaleString()}
|
||||
</small>
|
||||
</div>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user