<commit_before>import React, { Component } from 'react';
import { Dropdown } from './dropdown';
import { cite } from '../../lib/util';

export class Subscribers extends Component {
  constructor(props){
    super(props);
    this.redirect = this.redirect.bind(this);
    this.addUser = this.addUser.bind(this);
    this.removeUser = this.removeUser.bind(this);
  }

  addUser(who, path) {
    let action = {
      add: {
        members: [who],
        path: path,
      }
    }
    window.api.action("group-store", "group-action", action);
  }

  removeUser(who, path) {
    let action = {
      remove: {
        members: [who],
        path: path,
      }
    }
    window.api.action("group-store", "group-action", action);
  }

  redirect(url) {
    window.location.href = url;
  }

  render() {
    let readPath = this.props.notebook["subscribers-group-path"]
    let readPerms = (readPath)
      ? this.props.permissions[readPath]
      : null;
    let writePath = this.props.notebook["writers-group-path"]
    let writePerms = (writePath)
      ? this.props.permissions[writePath]
      : null;

    let writers = [];
    if (writePerms && writePerms.kind === 'white') {
      let withoutUs = new Set(writePerms.who)
      withoutUs.delete(window.ship);
      writers = Array.from(withoutUs).map((who, i) => {
        let width = 0;
        let options = [];
        if (readPath === writePath) {
          width = 258;
          let url = `/~contacts${writePath}`;
          options = [{
            cls: "bg-transparent white-d tl pointer w-100 db hover-bg-gray4 hover-bg-gray1-d ph2 pv3",
            txt: "Manage this group in the contacts view",<commit_msg>publish: amend URL to Groups view<commit_after>import React, { Component } from 'react';
import { Dropdown } from './dropdown';
import { cite } from '../../lib/util';

export class Subscribers extends Component {
  constructor(props){
    super(props);
    this.redirect = this.redirect.bind(this);
    this.addUser = this.addUser.bind(this);
    this.removeUser = this.removeUser.bind(this);
  }

  addUser(who, path) {
    let action = {
      add: {
        members: [who],
        path: path,
      }
    }
    window.api.action("group-store", "group-action", action);
  }

  removeUser(who, path) {
    let action = {
      remove: {
        members: [who],
        path: path,
      }
    }
    window.api.action("group-store", "group-action", action);
  }

  redirect(url) {
    window.location.href = url;
  }

  render() {
    let readPath = this.props.notebook["subscribers-group-path"]
    let readPerms = (readPath)
      ? this.props.permissions[readPath]
      : null;
    let writePath = this.props.notebook["writers-group-path"]
    let writePerms = (writePath)
      ? this.props.permissions[writePath]
      : null;

    let writers = [];
    if (writePerms && writePerms.kind === 'white') {
      let withoutUs = new Set(writePerms.who)
      withoutUs.delete(window.ship);
      writers = Array.from(withoutUs).map((who, i) => {
        let width = 0;
        let options = [];
        if (readPath === writePath) {
          width = 258;
          let url = `/~groups${writePath}`;
          options = [{
            cls: "bg-transparent white-d tl pointer w-100 db hover-bg-gray4 hover-bg-gray1-d ph2 pv3",
            txt: "Manage this group",
{'fraction_non_alphanumeric': 0.14662668665667167, 'fraction_numerical': 0.006596701649175412, 'mean_word_length': 2.3696969696969696, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3524081', 'n_tokens_mistral': 1088, 'n_tokens_neox': 1061, 'n_words': 234}