feat: add feedback button

This commit is contained in:
Henry
2024-03-08 08:28:40 +00:00
parent 6d9a4346f0
commit ab7f799f88
7 changed files with 3395 additions and 7 deletions

View File

@@ -0,0 +1,29 @@
"use client";
import { useState } from "react";
import LottieIcon from "~/app/components/LottieIcon";
import chatIcon from "~/app/assets/chat.json";
const FeedbackButton: React.FC = () => {
const [isHovered, setIsHovered] = useState(false);
const [index, setIndex] = useState(0);
const handleMouseEnter = () => {
setIsHovered(true);
setIndex((index) => index + 1);
};
return (
<button
type="button"
onMouseEnter={handleMouseEnter}
className="flex items-center rounded-md border-[1px] border-dark-600 bg-dark-50 px-2.5 py-1.5 text-sm font-normal text-dark-1000 shadow-sm"
>
<LottieIcon index={index} json={chatIcon} isPlaying={isHovered} />
<span className="ml-1">Feedback</span>
</button>
);
};
export default FeedbackButton;