glitch-soc/app/javascript/flavours/glitch/components/load_gap.tsx
たいち ひ 6a592083f1 [Glitch] Fix export style of <LoadGap /> based on <Domain />
Port 4197b5e4c8 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-28 17:15:21 +02:00

36 lines
867 B
TypeScript

import { useCallback } from 'react';
import type { InjectedIntl } from 'react-intl';
import { injectIntl, defineMessages } from 'react-intl';
import { Icon } from 'flavours/glitch/components/icon';
const messages = defineMessages({
load_more: { id: 'status.load_more', defaultMessage: 'Load more' },
});
interface Props {
disabled: boolean;
maxId: string;
onClick: (maxId: string) => void;
intl: InjectedIntl;
}
const _LoadGap: React.FC<Props> = ({ disabled, maxId, onClick, intl }) => {
const handleClick = useCallback(() => {
onClick(maxId);
}, [maxId, onClick]);
return (
<button
className='load-more load-gap'
disabled={disabled}
onClick={handleClick}
aria-label={intl.formatMessage(messages.load_more)}
>
<Icon id='ellipsis-h' />
</button>
);
};
export const LoadGap = injectIntl(_LoadGap);