<commit_before>// ─────────────────────────────────────────────────────────────────────────────
// import
// ─────────────────────────────────────────────────────────────────────────────

import React from 'react';
import { arrayOf, shape, string, number } from 'prop-types';

import { Ul, Li, Link, P } from '~components';

// ─────────────────────────────────────────────────────────────────────────────
// component
// ─────────────────────────────────────────────────────────────────────────────

export default function BlogPreviewsContainer({ posts }) {
  return (
    <Ul>
      {posts.edges.map(({ node: { frontmatter: { title, date, meta }, timeToRead } }) => (
        <Li key={meta.permalink}>
          <Link to={meta.permalink} look="tertiary">
            {title}
          </Link>
          {(date || timeToRead) && (
            <P opacity="0.75" fontSize="1.5rem" lineHeight="2rem" margin="0 0 2rem 0">
              {`${date} • ${timeToRead} min read`}
            </P>
          )}
        </Li>
      ))}
    </Ul>
  );
}

BlogPreviewsContainer.propTypes = {
  posts: shape({
    edges: arrayOf(
      shape({
        node: shape({
          frontmatter: shape({
            title: string.isRequired,
            date:  string.isRequired,
            meta:  shape({
              permalink: string.isRequired,
            }).isRequired,
          }).isRequired,<commit_msg>update blog previews layout logic<commit_after>// ─────────────────────────────────────────────────────────────────────────────
// import
// ─────────────────────────────────────────────────────────────────────────────

import React from 'react';
import { arrayOf, shape, string, number } from 'prop-types';

import { Ul, Li, Link, P } from '~components';

// ─────────────────────────────────────────────────────────────────────────────
// component
// ─────────────────────────────────────────────────────────────────────────────

export default function BlogPreviewsContainer({ posts }) {
  return (
    <Ul>
      {posts.edges.map(({ node: { frontmatter: { title, date, meta }, timeToRead } }) => (
        <Li key={meta.permalink} lineHeight="3rem">
          <Link to={meta.permalink} look="tertiary" display="block" padding="0.5rem 0">
            {title}
          </Link>
          {(date || timeToRead) && (
            <P opacity="0.75" fontSize="1.5rem" lineHeight="2rem" margin="0 0 2rem 0">
              {`${date} • ${timeToRead} min read`}
            </P>
          )}
        </Li>
      ))}
    </Ul>
  );
}

BlogPreviewsContainer.propTypes = {
  posts: shape({
    edges: arrayOf(
      shape({
        node: shape({
          frontmatter: shape({
            title: string.isRequired,
            date:  string.isRequired,
            meta:  shape({
              permalink: string.isRequired,
            }).isRequired,
          }).isRequired,
{'fraction_non_alphanumeric': 0.3392794683455754, 'fraction_numerical': 0.008394543546694649, 'mean_word_length': 2.7239583333333335, 'pattern_counts': {'":': 0, '<': 19, '<?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': '5817518', 'n_tokens_mistral': 1035, 'n_tokens_neox': 787, 'n_words': 175}