From 5d8cfb37bea6801b02af2dfccb503b078db46194 Mon Sep 17 00:00:00 2001 From: John Doe Date: Mon, 11 Sep 2023 17:21:35 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Implemented=20CardAuthorBox=20co?= =?UTF-8?q?mponent=20=E2=9C=A8=20Added=20author=20information=20rendering?= =?UTF-8?q?=20=F0=9F=8C=9F=20Enhanced=20styling=20for=20CardAuthorBox=20?= =?UTF-8?q?=F0=9F=93=9A=20Updated=20CardAuthorBox=20documentation=20?= =?UTF-8?q?=F0=9F=A9=BA=20Fixed=20minor=20issues=20in=20CardAuthorBox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CardAuthorBox.tsx | 58 ++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/components/CardAuthorBox.tsx diff --git a/src/components/CardAuthorBox.tsx b/src/components/CardAuthorBox.tsx new file mode 100644 index 0000000..fd7d4ee --- /dev/null +++ b/src/components/CardAuthorBox.tsx @@ -0,0 +1,58 @@ +import React, { FC } from "react"; +import { AuthorType } from "@/data/types"; +import { StarIcon } from "@heroicons/react/24/solid"; +import Avatar from "@/shared/Avatar"; +import Badge from "@/shared/Badge"; +import Link from "next/link"; + +export interface CardAuthorBoxProps { + className?: string; + author: AuthorType; + index?: number; +} + +const CardAuthorBox: FC = ({ + className = "", + author, + index, +}) => { + const { displayName, href = "/", avatar, starRating } = author; + return ( + + {index && ( + + )} + +
+

+ {displayName} +

+ + New York + +
+
+ + {starRating || 4.9} + + +
+ + ); +}; + +export default CardAuthorBox;