import { getTimeString } from "@/helpers/datetime";
import MemoContent from "./MemoContent";
import MemoResourceListView from "./MemoResourceListView";
import "@/less/daily-memo.less";

interface Props {
  memo: Memo;
}

const DailyMemo: React.FC<Props> = (props: Props) => {
  const { memo } = props;
  const displayTimeStr = getTimeString(memo.displayTs);

  return (
    <div className="daily-memo-wrapper">
      <div className="time-wrapper">
        <span className="normal-text">{displayTimeStr}</span>
      </div>
      <div className="memo-container">
        <MemoContent content={memo.content} />
        <MemoResourceListView resourceList={memo.resourceList} />
      </div>
      <div className="split-line"></div>
    </div>
  );
};

export default DailyMemo;
