import React from 'react';
import CreatePost from './CreatePost';
import { useUser } from '../../../context/UserContext'; // 注意路径


const CreatePostPage = () => {
  const store = useUser?.();
  const user = store?.user;

  // 可以加个判断
  if (!user) {
    return <p>请先登录后再发帖。</p>;
  }

  return (
    <div className="create-post-page">
      <CreatePost userId={user.userId} />
    </div>
  );
};

export default CreatePostPage;
