<commit_before><commit_msg>home-page<commit_after>import * as React from "react";
import {
  Paper,
  Tab,
  Tabs
} from "material-ui";
import { Page } from "../components";
import {
  RouteComponentProps,
  Link
} from "react-router-dom";
import { UserData } from "../models";
import { ObjectOmit } from "typelevel-ts";
import { connect } from "react-redux";
import { Store } from "../reducers";
import {
  TagFavo,
  TopicFavo
} from "../components";

type _HomePageProps = {
  user: UserData | null
} & RouteComponentProps<{}>;

export type HomPageProps = ObjectOmit<_HomePageProps, 'user'>;

function _HomePage(props: _HomePageProps) {
  return <Page column={1}>
    {props.user !== null
      ? <Tabs>
        <Tab label="トピック">
          <TopicFavo />
        </Tab>
        <Tab label="タグ">
          <TagFavo />
        </Tab>
      </Tabs>
      : <Paper>
        <h1>匿名掲示板Anontownへようこそ</h1>
        <ul>
          <li>
            <Link to="/topic/search">トピック一覧</Link>
          </li>
          <li>
            <a href="https://document.anontown.com/"
              target="_blank">説明書</a>
          </li>
        </ul>
      </Paper>}
  </Page>;
}

export const HomePage = connect((state: Store) => ({ user: state.user }))(_HomePage);
{'fraction_non_alphanumeric': 0.16680032076984763, 'fraction_numerical': 0.0024057738572574178, 'mean_word_length': 2.3548387096774195, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 30, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4075471', 'n_tokens_mistral': 437, 'n_tokens_neox': 430, 'n_words': 93}