post.tsx 574 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
import React, { MouseEventHandler } from "react";
import { PostType } from "../types";

type Props = {
  post: PostType;
  handleClick: MouseEventHandler;
};

export default function Post({ handleClick, post }: Props) {
  return (
    <div className="flex flex-row h-16 divide-x-2 border-2 border-solid">
      <div className="basis-full">
Lee Soobeom's avatar
Lee Soobeom committed
13
        <button id={post.userId} onClick={handleClick}>
14
15
16
17
18
19
20
21
          {post.title}
        </button>
      </div>
      <div className="basis-3/12">{post.date}</div>
      <div className="basis-2/12">{post.counts}</div>
    </div>
  );
}