|
@@ -4,13 +4,16 @@ import { UserOutlined, MessageOutlined, HeartOutlined, SendOutlined } from '@ant
|
|
|
import { useAuth } from '@/client/home/hooks/AuthProvider';
|
|
import { useAuth } from '@/client/home/hooks/AuthProvider';
|
|
|
import { useNavigate } from 'react-router-dom';
|
|
import { useNavigate } from 'react-router-dom';
|
|
|
import { postClient } from '@/client/api';
|
|
import { postClient } from '@/client/api';
|
|
|
-import type { PostEntity } from '@/server/modules/posts/post.entity';
|
|
|
|
|
|
|
+import { InferResponseType } from 'hono';
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+type Post = InferResponseType<typeof postClient.$get, 200>['data'][0];
|
|
|
|
|
|
|
|
const { Header, Content, Footer } = Layout;
|
|
const { Header, Content, Footer } = Layout;
|
|
|
const { Title, Text, Paragraph } = Typography;
|
|
const { Title, Text, Paragraph } = Typography;
|
|
|
|
|
|
|
|
const HomePage: React.FC = () => {
|
|
const HomePage: React.FC = () => {
|
|
|
- const [posts, setPosts] = useState<PostEntity[]>([]);
|
|
|
|
|
|
|
+ const [posts, setPosts] = useState<Post[]>([]);
|
|
|
const [loading, setLoading] = useState(true);
|
|
const [loading, setLoading] = useState(true);
|
|
|
const [content, setContent] = useState('');
|
|
const [content, setContent] = useState('');
|
|
|
const { user } = useAuth();
|
|
const { user } = useAuth();
|