mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-16 01:01:38 +00:00
* Fix post toc style * Add loading skeleton * add post comment loading anime * update underline style
41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
import { FC } from 'react';
|
|
import cn from 'classnames';
|
|
import dynamic from 'next/dynamic';
|
|
import { AllPostsWithMatter } from 'lib/posts';
|
|
|
|
const DateFormater = dynamic(() => import('components/DateFormater'));
|
|
const Link = dynamic(() => import('components/PathLink'));
|
|
|
|
interface Props {
|
|
post: AllPostsWithMatter;
|
|
}
|
|
|
|
const ArchiveCard: FC<Props> = ({ post }) => {
|
|
const { id, title, url, date } = post;
|
|
|
|
return (
|
|
<>
|
|
<Link
|
|
href={`p/${url}`}
|
|
className={cn(
|
|
'block',
|
|
'bg-underline bg-bottom bg-no-repeat bg-[length:95%_2px]',
|
|
'duration-300 transition-all',
|
|
'last:bg-none dark:bg-underline-dark',
|
|
'hover:bg-[length:100%_2px]'
|
|
)}
|
|
>
|
|
<div className={cn('p-5')}>
|
|
<h2 className="font-semibold text-lg mb-2">{title}</h2>
|
|
<DateFormater
|
|
dateString={date}
|
|
className="text-sm text-gray-600 dark:text-gray-400"
|
|
/>
|
|
</div>
|
|
</Link>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default ArchiveCard;
|