// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import React from 'react'; import {Platform, View} from 'react-native'; import CompassIcon from '@components/compass_icon'; import FormattedText from '@components/formatted_text'; import PostPriorityLabel from '@components/post_priority/post_priority_label'; import {PostPriorityColors} from '@constants/post'; import {useTheme} from '@context/theme'; import {makeStyleSheetFromTheme} from '@utils/theme'; type Props = { postPriority: PostPriority; noMentionsError: boolean; } const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => ({ container: { flexDirection: 'row', alignItems: 'center', marginLeft: 12, gap: 7, }, error: { color: PostPriorityColors.URGENT, }, acknowledgements: { color: theme.onlineIndicator, }, paddingTopStyle: { paddingTop: Platform.select({ios: 6, android: 8}), }, })); export default function DraftInputHeader({ postPriority, noMentionsError, }: Props) { const theme = useTheme(); const hasLabels = postPriority.priority !== '' || postPriority.requested_ack; const style = getStyleSheet(theme); return ( {postPriority.priority && ( )} {postPriority.requested_ack && ( <> {!postPriority.priority && ( )} )} {postPriority.persistent_notifications && ( <> {noMentionsError && ( )} )} ); }