'use client'

import { Button } from '@/components/ui/button'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { router } from '@inertiajs/react'
import { RefreshCcw } from 'lucide-react'

export default function ReloadButton({ reload }: { reload?: () => void }) {


    return <Tooltip>
        <TooltipTrigger asChild>
            <Button onClick={() => reload ? reload() : router.reload()} size='icon-sm' variant='outline' className='active:scale-95  hover:scale-105 ease-in-out ' ><RefreshCcw /></Button>
        </TooltipTrigger>
        <TooltipContent>
            <p className="max-w-64">Refresh the Page</p>
        </TooltipContent>
    </Tooltip>
}

