import * as React from 'react';
import { BlueRain, BlueRainConsumer } from '@blueeast/bluerain-os';
import { style } from './style';

// get the locally stored image
const emptyComponent = () => {
	const title = 'No Apps Installed';
	return (
		<BlueRainConsumer>
			{(BR: BlueRain) => {
				const emptyImage = BR.Configs.get('plugins.launcher.images.emptyPage');
				return BR.Components.ComponentState ? (
					<BR.Components.View style={style.noAppView}>
						<BR.Components.ComponentState
							imageSource={emptyImage}
							imageStyle={style.noAppImage}
							title={title}
							titleStyle={style.noAppTitle}
						/>
					</BR.Components.View>
				) : null
			}}
		</BlueRainConsumer>
	);
};

export default emptyComponent;