Refactor chatInput component to use Popover for repetitions input

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-01-26 17:08:44 -03:00
commit 174cd37a2b

View file

@ -4,8 +4,8 @@ import { Textarea } from "../../../components/ui/textarea";
import { chatInputType } from "../../../types/components";
import { classNames } from "../../../utils/utils";
import { Button } from "../../ui/button";
import { Popover, PopoverContent, PopoverTrigger } from "../../ui/popover";
import { Input } from "../../ui/input";
import { Popover, PopoverContent, PopoverTrigger } from "../../ui/popover";
export default function ChatInput({
lockChat,
@ -120,17 +120,19 @@ export default function ChatInput({
<IconComponent name="Repeat" className="" aria-hidden="true" />
</Button>
</PopoverTrigger>
<PopoverContent className="w-fit"><div className="flex flex-col gap-2 items-center justify-center">
<span className="text-sm">Repetitions: </span>
<Input
onChange={(e) => {
handleChange(parseInt(e.target.value));
}}
className="w-16"
type="number"
min={0}
/>
</div></PopoverContent>
<PopoverContent className="w-fit">
<div className="flex flex-col items-center justify-center gap-2">
<span className="text-sm">Repetitions: </span>
<Input
onChange={(e) => {
handleChange(parseInt(e.target.value));
}}
className="w-16"
type="number"
min={0}
/>
</div>
</PopoverContent>
</Popover>
</div>
);