mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-03 17:20:00 +02:00
55a6ea4fca
* Prevent double fetching when force refreshing paginated views * remove await from infinite list loader query invalidation * add mutation and loading state to list refresh * add non-suspense query to list genre filters to add loading state * remove list count data set on random queries --------- Co-authored-by: jeffvli <jeffvictorli@gmail.com>
30 lines
793 B
TypeScript
30 lines
793 B
TypeScript
import { useTranslation } from 'react-i18next';
|
|
|
|
import { ActionIcon, ActionIconProps } from '/@/shared/components/action-icon/action-icon';
|
|
|
|
interface RefreshButtonProps extends ActionIconProps {
|
|
loading?: boolean;
|
|
}
|
|
|
|
export const RefreshButton = ({ loading, onClick, ...props }: RefreshButtonProps) => {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<ActionIcon
|
|
icon="refresh"
|
|
iconProps={{
|
|
size: 'lg',
|
|
...props.iconProps,
|
|
}}
|
|
loading={loading}
|
|
onClick={onClick}
|
|
tooltip={{
|
|
label: t('common.refresh', { postProcess: 'sentenceCase' }),
|
|
...props.tooltip,
|
|
}}
|
|
variant="subtle"
|
|
{...props}
|
|
/>
|
|
);
|
|
};
|