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

40 lines
779 B
TypeScript

import { useStore } from "@/_models/RootStore";
import Image from "next/image";
import React from "react";
type Props = {
imageUrl: string;
isSelected: boolean;
conversationId: string;
};
const CompactHistoryItem: React.FC<Props> = ({
imageUrl,
isSelected,
conversationId,
}) => {
const { historyStore } = useStore();
const onClick = () => {
historyStore.setActiveConversationId(conversationId);
};
return (
<button
onClick={onClick}
className={`${
isSelected ? "bg-gray-100" : "bg-transparent"
} p-2 rounded-lg`}
>
<Image
className="rounded-full"
src={imageUrl}
width={36}
height={36}
alt=""
/>
</button>
);
};
export default React.memo(CompactHistoryItem);