Files
tonePage/tone-page-web/app/blog/page.tsx

26 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { useCallback } from "react"
export default function Blog() {
const formatNumber = useCallback((num: number) => {
if (num >= 1000) {
return (num / 1000).toFixed(1) + 'K';
} else if (num >= 1000000) {
return (num / 1000000).toFixed(1) + 'M';
}
return num.toString();
}, []);
return (
<div className="max-w-120 w-auto mx-auto my-10 flex flex-col gap-8">
{
Array.from({ length: 10 }).map(() => (
<div className="w-full px-5 cursor-default" >
<a className="text-2xl font-medium cursor-pointer" target="_black"></a>
<p className="text-sm font-medium text-zinc-400">asdjkasdas </p>
<p className="text-sm font-medium text-zinc-400 mt-3">{new Date().toLocaleString()} · {formatNumber(1090)} 访</p>
</div>
))
}
</div>
)
}