From c9c1c90b30e243563bb4f731da15b3fe657556d2 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Mon, 6 Nov 2023 18:08:04 +0100
Subject: refactor(components): replace Summary component with PostPreview

* rename component to PostPreview because Summary is an HTML element
and it could lead to confusion
* replace `title` and `titleLevel` with `heading` and `headingLvl`
because `title` is a native attribute
* rename `intro` prop to `excerpt`
* extract `cover` from `meta` prop
* rewrite meta type
* extract meta logic into a new component
---
 .../organisms/layout/posts-list.fixture.tsx        | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 src/components/organisms/layout/posts-list.fixture.tsx

(limited to 'src/components/organisms/layout/posts-list.fixture.tsx')

diff --git a/src/components/organisms/layout/posts-list.fixture.tsx b/src/components/organisms/layout/posts-list.fixture.tsx
new file mode 100644
index 0000000..e1f7a95
--- /dev/null
+++ b/src/components/organisms/layout/posts-list.fixture.tsx
@@ -0,0 +1,62 @@
+import NextImage from 'next/image';
+import type { PostData } from './posts-list';
+
+export const introPost1 =
+  'Esse et voluptas sapiente modi impedit unde et. Ducimus nulla ea impedit sit placeat nihil assumenda. Rem est fugiat amet quo hic. Corrupti fuga quod animi autem dolorem ullam corrupti vel aut.';
+
+export const introPost2 =
+  'Illum quae asperiores quod aut necessitatibus itaque excepturi voluptas. Incidunt exercitationem ullam saepe alias consequatur sed. Quam veniam quaerat voluptatum earum quia quisquam fugiat sed perspiciatis. Et velit saepe est recusandae facilis eos eum ipsum.';
+
+export const introPost3 =
+  'Sunt aperiam ut rem impedit dolor id sit. Reprehenderit ipsum iusto fugiat. Quaerat laboriosam magnam facilis. Totam sint aliquam voluptatem in quis laborum sunt eum. Enim aut debitis officiis porro iure quia nihil voluptas ipsum. Praesentium quis necessitatibus cumque quia qui velit quos dolorem.';
+
+export const cover = {
+  alt: 'cover',
+  height: 480,
+  src: 'http://picsum.photos/640/480',
+  width: 640,
+};
+
+export const posts: PostData[] = [
+  {
+    cover: <NextImage {...cover} />,
+    excerpt: introPost1,
+    id: 'post-1',
+    meta: {
+      publicationDate: '2022-02-26',
+      wordsCount: introPost1.split(' ').length,
+      thematics: [
+        { id: 1, name: 'Cat 1', url: '#' },
+        { id: 2, name: 'Cat 2', url: '#' },
+      ],
+      comments: { count: 1, postHeading: 'Ratione velit fuga' },
+    },
+    heading: 'Ratione velit fuga',
+    url: '#',
+  },
+  {
+    excerpt: introPost2,
+    id: 'post-2',
+    meta: {
+      publicationDate: '2022-02-20',
+      wordsCount: introPost2.split(' ').length,
+      thematics: [{ id: 2, name: 'Cat 2', url: '#' }],
+      comments: { count: 0, postHeading: 'Debitis laudantium laudantium' },
+    },
+    heading: 'Debitis laudantium laudantium',
+    url: '#',
+  },
+  {
+    cover: <NextImage {...cover} />,
+    excerpt: introPost3,
+    id: 'post-3',
+    meta: {
+      publicationDate: '2021-12-20',
+      wordsCount: introPost3.split(' ').length,
+      thematics: [{ id: 1, name: 'Cat 1', url: '#' }],
+      comments: { count: 3, postHeading: 'Quaerat ut corporis' },
+    },
+    heading: 'Quaerat ut corporis',
+    url: '#',
+  },
+];
-- 
cgit v1.2.3

