2022-08-18 09:52:04 -07:00
|
|
|
import React from 'react';
|
2022-09-14 07:35:32 -07:00
|
|
|
import { defineMessages, useIntl } from 'react-intl';
|
2022-08-18 09:52:04 -07:00
|
|
|
|
|
|
|
import { Button, Stack, Text } from 'soapbox/components/ui';
|
|
|
|
|
2022-09-14 07:35:32 -07:00
|
|
|
const messages = defineMessages({
|
|
|
|
title: { id: 'chat_search.empty_results_blankslate.title', defaultMessage: 'No messages yet' },
|
2022-12-07 13:52:51 -08:00
|
|
|
body: { id: 'chat_search.empty_results_blankslate.body', defaultMessage: 'Search for someone to chat with.' },
|
2022-09-14 07:35:32 -07:00
|
|
|
action: { id: 'chat_search.empty_results_blankslate.action', defaultMessage: 'Message someone' },
|
|
|
|
});
|
|
|
|
|
|
|
|
interface IBlankslate {
|
|
|
|
onSearch(): void
|
|
|
|
}
|
|
|
|
|
|
|
|
const Blankslate = ({ onSearch }: IBlankslate) => {
|
|
|
|
const intl = useIntl();
|
2022-08-18 09:52:04 -07:00
|
|
|
|
2022-09-14 07:35:32 -07:00
|
|
|
return (
|
2022-10-03 08:03:43 -07:00
|
|
|
<Stack
|
|
|
|
alignItems='center'
|
|
|
|
justifyContent='center'
|
|
|
|
className='h-full flex-grow'
|
|
|
|
data-testid='chat-pane-blankslate'
|
|
|
|
>
|
2022-09-14 07:35:32 -07:00
|
|
|
<Stack space={4}>
|
2022-09-23 06:04:01 -07:00
|
|
|
<Stack space={1} className='max-w-[80%] mx-auto'>
|
2022-09-14 07:35:32 -07:00
|
|
|
<Text size='lg' weight='bold' align='center'>
|
|
|
|
{intl.formatMessage(messages.title)}
|
|
|
|
</Text>
|
|
|
|
|
|
|
|
<Text theme='muted' align='center'>
|
|
|
|
{intl.formatMessage(messages.body)}
|
|
|
|
</Text>
|
|
|
|
</Stack>
|
|
|
|
|
|
|
|
<div className='mx-auto'>
|
|
|
|
<Button theme='primary' onClick={onSearch}>
|
|
|
|
{intl.formatMessage(messages.action)}
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</Stack>
|
|
|
|
</Stack>
|
|
|
|
);
|
|
|
|
};
|
2022-08-18 09:52:04 -07:00
|
|
|
|
|
|
|
export default Blankslate;
|