mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 22:29:11 +03:00
29 lines
622 B
TypeScript
29 lines
622 B
TypeScript
import { LoaderCircle, RefreshCcw } from 'lucide-react'
|
|
import { Button } from 'ui'
|
|
|
|
import { useDataTable } from './providers/DataTableProvider'
|
|
|
|
interface RefreshButtonProps {
|
|
onClick: () => void
|
|
}
|
|
|
|
export function RefreshButton({ onClick }: RefreshButtonProps) {
|
|
const { isLoading } = useDataTable()
|
|
|
|
return (
|
|
<Button
|
|
type="outline"
|
|
size="small"
|
|
disabled={isLoading}
|
|
onClick={onClick}
|
|
className="h-9 w-9 px-0"
|
|
>
|
|
{isLoading ? (
|
|
<LoaderCircle className="h-4 w-4 animate-spin" />
|
|
) : (
|
|
<RefreshCcw className="h-4 w-4" />
|
|
)}
|
|
</Button>
|
|
)
|
|
}
|