<commit_before>import "admin/AdminListItem.styl";

import { h, Component } from "preact";

import api from "api.js";

class AdminListItem extends Component {
	deleteNotification(id) {
		var that = this;
		if (confirm("Are you sure you want to delete this notification?")) {
			api.post("notifications/delete", {
				id: id
			}, function() {
				alert("Deleted!");
				that.props.load.call(that);
			});
		}
	}

	render(props, state) {
		if (props.type == "user") {
			return <div class="adminListItem">
				<p class="adminListName">{props.data.name}</p>
				<div>
					<span>{props.data.id} | {props.data.username} | {props.data.email} | {props.data.type} | Level {props.data.level} </span>
					<span>| Show migrate message? {props.data.showMigrateMessage == 1 ? "yes" : "no"}</span>
				</div>
			</div>;
		} else if (props.type == "feedback") {
			return <div class="adminListItem">
				<p class="adminListName">{props.data.text}</p>
				<div>
					<span>{props.data.id} | User {props.data.userid} | {props.data.type} | {props.data.timestamp}</span><commit_msg>display user name and email for feedback<commit_after>import "admin/AdminListItem.styl";

import { h, Component } from "preact";

import api from "api.js";

class AdminListItem extends Component {
	deleteNotification(id) {
		var that = this;
		if (confirm("Are you sure you want to delete this notification?")) {
			api.post("notifications/delete", {
				id: id
			}, function() {
				alert("Deleted!");
				that.props.load.call(that);
			});
		}
	}

	render(props, state) {
		if (props.type == "user") {
			return <div class="adminListItem">
				<p class="adminListName">{props.data.name}</p>
				<div>
					<span>{props.data.id} | {props.data.username} | {props.data.email} | {props.data.type} | Level {props.data.level} </span>
					<span>| Show migrate message? {props.data.showMigrateMessage == 1 ? "yes" : "no"}</span>
				</div>
			</div>;
		} else if (props.type == "feedback") {
			return <div class="adminListItem">
				<p class="adminListName">{props.data.text}</p>
				<div>
					<span>{props.data.id} | {props.data.userName} ({props.data.userEmail}) | {props.data.type} | {props.data.timestamp}</span>
{'fraction_non_alphanumeric': 0.18632400183570444, 'fraction_numerical': 0.0009178522257916476, 'mean_word_length': 3.6881720430107525, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '939117', 'n_tokens_mistral': 863, 'n_tokens_neox': 750, 'n_words': 161}