aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/views/home/BoardWithUser.tsx
blob: 469eb388ecd46f8f52ed802d76fab4837aa8553e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from "react";
import { Row, Col } from "react-bootstrap";
import { useTranslation } from "react-i18next";

import { AuthUser } from "@/services/user";
import { getHttpHighlightClient } from "@/http/highlight";
import { getHttpTimelineClient } from "@/http/timeline";

import TimelineBoard from "./TimelineBoard";

const BoardWithUser: React.FC<{ user: AuthUser }> = ({ user }) => {
  const { t } = useTranslation();

  return (
    <Row className="my-3 justify-content-center">
      <Col xs="12" md="6">
        <TimelineBoard
          title={t("home.highlightTimeline")}
          load={() => getHttpHighlightClient().list()}
        />
      </Col>
      <Col xs="12" md="6" className="my-3 my-md-0">
        <TimelineBoard
          title={t("home.relatedTimeline")}
          load={() =>
            getHttpTimelineClient().listTimeline({ relate: user.username })
          }
        />
      </Col>
    </Row>
  );
};

export default BoardWithUser;