mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 22:29:11 +03:00
30 lines
649 B
TypeScript
30 lines
649 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
|
|
size="tiny"
|
|
type="outline"
|
|
disabled={isLoading}
|
|
onClick={onClick}
|
|
className="w-[26px]"
|
|
icon={
|
|
isLoading ? (
|
|
<LoaderCircle className="text-foreground animate-spin" />
|
|
) : (
|
|
<RefreshCcw className="text-foreground" />
|
|
)
|
|
}
|
|
/>
|
|
)
|
|
}
|