blob: ce52a9a04b683e9eae4b0e7cdfb1ba23ba93be7e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import * as React from 'react';
import { useTranslation } from 'react-i18next';
import { useUpdateAllRuleProviderItems } from 'src/components/rules/rules.hooks';
import { Fab, position as fabPosition } from 'src/components/shared/Fab';
import { RotateIcon } from 'src/components/shared/RotateIcon';
import { ClashAPIConfig } from 'src/types';
type RulesPageFabProps = {
apiConfig: ClashAPIConfig;
};
export function RulesPageFab({ apiConfig }: RulesPageFabProps) {
const [update, isLoading] = useUpdateAllRuleProviderItems(apiConfig);
const { t } = useTranslation();
return (
<Fab
icon={<RotateIcon isRotating={isLoading} />}
text={t('update_all_rule_provider')}
style={fabPosition}
onClick={update}
/>
);
}
|