import type { CurrentUser, SiteSettings } from '../env';
import type { CommentView } from '../services/comments';
import type { FeedPost } from '../services/posts';
import { PostItem } from './components/post-item';
import { Layout } from './layout';

export function PostDetailPage(props: {
  settings: SiteSettings;
  currentUser: CurrentUser | null;
  csrfToken: string;
  post: FeedPost;
  comments: CommentView[];
  links: Array<{ id: string; name: string; url: string; avatar: string | null; description: string; category: string }>;
}) {
  return (
    <Layout settings={props.settings} currentUser={props.currentUser} csrfToken={props.csrfToken} links={props.links} title="详情" showHero={false}>
      <div class="detail-page">
        <PostItem post={props.post} comments={props.comments} settings={props.settings} currentUser={props.currentUser} />
      </div>
    </Layout>
  );
}
