// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {StyleSheet, View} from 'react-native';
import ErrorText from '@components/error_text';
import MenuDivider from '@components/menu_divider';
type PostErrorProps = {
errorLine?: string;
errorExtra?: string;
}
const styles = StyleSheet.create({
errorContainerSplit: {
paddingHorizontal: 16,
flexDirection: 'row',
justifyContent: 'space-between',
width: '100%',
},
errorContainer: {
paddingHorizontal: 16,
width: '100%',
},
errorWrap: {
flexShrink: 1,
paddingRight: 20,
},
errorWrapper: {
alignItems: 'center',
},
errorText: {
fontSize: 13,
},
});
const PostError = ({errorLine, errorExtra}: PostErrorProps) => {
const hasError = Boolean(errorLine || errorExtra);
if (!hasError) {
return null;
}
return (
<>
{Boolean(errorLine) && (
)}
{Boolean(errorExtra) && (
)}
>
);
};
export default PostError;