vision-agent / components /ui /ButtonScrollToBottom.tsx
MingruiZhang's picture
feat: Customized Img and scroll to bottom (#18)
8e3dbd3 unverified
raw
history blame
854 Bytes
'use client';
import React from 'react';
import { cn } from '@/lib/utils';
import { Button, type ButtonProps } from '@/components/ui/Button';
import { IconArrowDown } from '@/components/ui/Icons';
interface ButtonScrollToBottomProps extends ButtonProps {
isAtBottom: boolean;
scrollToBottom: () => void;
}
export function ButtonScrollToBottom({
className,
isAtBottom,
scrollToBottom,
...props
}: ButtonScrollToBottomProps) {
return (
<Button
variant="outline"
size="icon"
className={cn(
'fixed bottom-16 right-4 z-10 bg-background transition-opacity duration-300',
isAtBottom ? 'opacity-0' : 'opacity-100',
className,
)}
onClick={() => scrollToBottom()}
{...props}
>
<IconArrowDown />
<span className="sr-only">Scroll to bottom</span>
</Button>
);
}