<commit_before>// Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

import StringWithComponent from 'components/string-with-component';
import BeatmapsetDiscussionPostJson from 'interfaces/beatmapset-discussion-post-json';
import UserJson from 'interfaces/user-json';
import { route } from 'laroute';
import * as React from 'react';
import { classWithModifiers } from 'utils/css';

interface Props {
  post: BeatmapsetDiscussionPostJson;
  user: UserJson;
}

export default function SystemPost({ post, user }: Props) {
  if (!post.system) return null;
  if (post.message.type !== 'resolved') return null;

  const className = classWithModifiers('beatmap-discussion-system-post', post.message.type, {
    deleted: post.deleted_at != null,
  });

  return (
    <div className={className}>
      <div className='beatmap-discussion-system-post__content'>
        <StringWithComponent
          mappings={{
            user: <a
              className='beatmap-discussion-system-post__user'
              href={route('users.show', { user: user.id })}
            >
              {user.username}
            </a>,
          }}
          pattern={osu.trans(`beatmap_discussions.system.resolved.${post.message.value}`)}
        />
      </div>
    </div>
  );
}<commit_msg>render blank content for unknown types<commit_after>// Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

import StringWithComponent from 'components/string-with-component';
import BeatmapsetDiscussionPostJson from 'interfaces/beatmapset-discussion-post-json';
import UserJson from 'interfaces/user-json';
import { route } from 'laroute';
import * as React from 'react';
import { classWithModifiers } from 'utils/css';

interface Props {
  post: BeatmapsetDiscussionPostJson;
  user: UserJson;
}

export default function SystemPost({ post, user }: Props) {
  if (!post.system) return null;
  if (post.message.type !== 'resolved') {
    console.error(`unknown type: ${post.message.type}`);
  }

  const className = classWithModifiers('beatmap-discussion-system-post', post.message.type, {
    deleted: post.deleted_at != null,
  });

  return (
    <div className={className}>
      <div className='beatmap-discussion-system-post__content'>
        {post.message.type === 'resolved' && (
          <StringWithComponent
            mappings={{
              user: <a
                className='beatmap-discussion-system-post__user'
                href={route('users.show', { user: user.id })}
              >
                {user.username}
              </a>,
            }}
            pattern={osu.trans(`beatmap_discussions.system.resolved.${post.message.value}`)}
          />
        )}
      </div>
    </div>
  );
}
{'fraction_non_alphanumeric': 0.1280383430332078, 'fraction_numerical': 0.0013693940431359123, 'mean_word_length': 2.959349593495935, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, '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': '2400241', 'n_tokens_mistral': 849, 'n_tokens_neox': 832, 'n_words': 208}