hiento09 86f0ffc7d1
Chore/disable submodule (#56)
* Chore disable git submodule for web-client and app-backend

* Chore add newest source code of app-backend and web-client

---------

Co-authored-by: Hien To <tominhhien97@gmail.com>
2023-09-05 16:29:07 +07:00

48 lines
1.3 KiB
TypeScript

import React from "react";
import Image from "next/image";
import {
ProductDetailFragment,
} from "@/graphql";
import useCreateConversation from "@/_hooks/useCreateConversation";
type Props = {
product: ProductDetailFragment;
};
const ConversationalCard: React.FC<Props> = ({ product }) => {
const { requestCreateConvo } = useCreateConversation();
const { name, image_url, description } = product;
return (
<button
onClick={() =>
requestCreateConvo(product)
}
className="flex flex-col justify-between flex-shrink-0 gap-3 bg-white p-4 w-52 rounded-lg text-left dark:bg-gray-700 hover:opacity-20"
>
<div className="flex flex-col gap-2 box-border">
<Image
width={32}
height={32}
src={image_url ?? ""}
className="rounded-full"
alt=""
/>
<h2 className="text-gray-900 font-semibold dark:text-white line-clamp-1 mt-2">
{name}
</h2>
<span className="text-gray-600 mt-1 font-normal line-clamp-2">
{description}
</span>
</div>
<span className="flex text-xs leading-5 text-gray-500 items-center gap-[2px]">
<Image src={"/icons/play.svg"} width={16} height={16} alt="" />
32.2k runs
</span>
</button>
);
};
export default React.memo(ConversationalCard);