<commit_before>import React, { Component } from "react";
import { Col } from "@tlon/indigo-react";
import { Notes, NoteId } from "../../../../types/publish-update";
import { NotePreview } from "./NotePreview";
import { Contacts } from "../../../../types/contact-update";

interface NotebookPostsProps {
  list: NoteId[];
  contacts: Contacts;
  notes: Notes;
  host: string;
  book: string;
}

export function NotebookPosts(props: NotebookPostsProps) {
  return (
    <Col>
      {props.list.map((noteId: NoteId) => {
        const note = props.notes[noteId];
        if (!note) {
          console.log(noteId);
          return null;
        }
        return (
          <NotePreview
            key={noteId}
            host={note?.author}
            book={props.book}
            note={note}
            contact={props.contacts[note.author.substr(1)]}
          />
        );
      })}
    </Col><commit_msg>publish: link preview correctly<commit_after>import React, { Component } from "react";
import { Col } from "@tlon/indigo-react";
import { Notes, NoteId } from "../../../../types/publish-update";
import { NotePreview } from "./NotePreview";
import { Contacts } from "../../../../types/contact-update";

interface NotebookPostsProps {
  list: NoteId[];
  contacts: Contacts;
  notes: Notes;
  host: string;
  book: string;
}

export function NotebookPosts(props: NotebookPostsProps) {
  return (
    <Col>
      {props.list.map((noteId: NoteId) => {
        const note = props.notes[noteId];
        if (!note) {
          console.log(noteId);
          return null;
        }
        return (
          <NotePreview
            key={noteId}
            host={props.host}
            book={props.book}
            note={note}
            contact={props.contacts[note.author.substr(1)]}
          />
        );
      })}
    </Col>
{'fraction_non_alphanumeric': 0.15869565217391304, 'fraction_numerical': 0.0010869565217391304, 'mean_word_length': 2.0785953177257523, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '3437200', 'n_tokens_mistral': 544, 'n_tokens_neox': 543, 'n_words': 118}