2022-05-28 09:02:04 -07:00
|
|
|
import React from 'react';
|
|
|
|
import { defineMessages, useIntl } from 'react-intl';
|
|
|
|
|
|
|
|
import Icon from 'soapbox/components/icon';
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
load_more: { id: 'status.load_more', defaultMessage: 'Load more' },
|
|
|
|
});
|
|
|
|
|
|
|
|
interface ILoadGap {
|
2023-02-15 13:26:27 -08:00
|
|
|
disabled?: boolean
|
|
|
|
maxId: string
|
|
|
|
onClick: (id: string) => void
|
2022-05-28 09:02:04 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
const LoadGap: React.FC<ILoadGap> = ({ disabled, maxId, onClick }) => {
|
|
|
|
const intl = useIntl();
|
|
|
|
|
|
|
|
const handleClick = () => onClick(maxId);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<button className='load-more load-gap' disabled={disabled} onClick={handleClick} aria-label={intl.formatMessage(messages.load_more)}>
|
2022-07-26 03:30:51 -07:00
|
|
|
<Icon src={require('@tabler/icons/dots.svg')} />
|
2022-05-28 09:02:04 -07:00
|
|
|
</button>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default LoadGap;
|