import { LoaderCircle, RefreshCcw } from 'lucide-react'
import { Button } from 'ui'
import { ButtonTooltip } from '../ButtonTooltip'
import { Shortcut } from '@/components/ui/Shortcut'
import type { ShortcutId } from '@/state/shortcuts/registry'
interface RefreshButtonProps {
isLoading: boolean
onRefresh: () => void
/**
* When provided, the button binds this registered shortcut (hotkey + a
* tooltip that surfaces the keybind). Otherwise it falls back to a plain
* "Refresh logs" tooltip with no keybind.
*/
shortcutId?: ShortcutId
}
export const RefreshButton = ({ isLoading, onRefresh, shortcutId }: RefreshButtonProps) => {
const icon = isLoading ? (
) : (
)
if (shortcutId) {
return (
)
}
return (
)
}