// Metro module 10378 (f10379).
import { memo, useMemo, useCallback } from "react";
import { View } from "react-native";
import ChannelStore from "../../../stores/ChannelStore";
import GuildStore from "../../../stores/GuildStore";
import { IN_APP_NOTIFICATION_MAX_HEIGHT, NOTIFICATION_PREVIEW_LINE_CLAMP, RIGHT_ACCESSORY_LEFT_MARGIN } from "./InAppNotificationConstants";
import { AnalyticEvents } from "../../../Constants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import { Avatar, AvatarSizes, CutoutDirection } from "../../../design/void/native";
import { ClockIcon } from "../../../design/components/Icon/native/redesign/generated/ClockIcon";
import Module712 from "../../../_bundle/Module712";
import { useHasPreviewableMedia, getMessagePreviewTextVariant } from "./InAppNotificationUtils";
import { MediaPreviewRightAccessory } from "./MediaPreviewRightAccessory";
import { useStateFromStores } from "../../../_bundle/Module589";
import { ChannelTypes } from "../../../_bundle/Module692";
import MessageNotificationHeader from "./MessageNotificationHeader";
import MessagePreviewText from "./MessagePreviewText";
import { ChannelRowPreview } from "../../main_tabs_v2/native/shared_components/ChannelRowPreview";
import { ChannelListLayoutTypes } from "../../main_tabs_v2/ChannelListLayoutTypes";
import Module38 from "../../../_bundle/Module38";
import { intl, t } from "../../../intl/index.native";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import { showForLaterModal } from "../../saved_messages/native/showForLaterModal";
import { SavedMessageSortTypes } from "../../saved_messages/SavedMessagesTypes";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import { NotificationPressable } from "./Notification";
let useStyles, cutout, Component, NotificationBody;
const NotificationAvatar = function NotificationAvatar(props) {
const { user, guildId } = props;
const styles = useStyles();
return
;
};
NotificationBody = function NotificationBody(props) {
const { channel, message } = props;
const stateFromStores = useStateFromStores([GuildStore], () => GuildStore.getGuild(channel.guild_id));
const stateFromStores2 = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channel.parent_id));
const hasPreviewableMedia = useHasPreviewableMedia(message);
const r2 = channel.type === ChannelTypes.DM;
const lineClamp = r2 ? NOTIFICATION_PREVIEW_LINE_CLAMP : 1;
const messagePreviewTextVariant = getMessagePreviewTextVariant();
return <>
{r2 ? null : }
{!hasPreviewableMedia && message.poll == null ? : }
>;
};
useStyles = createStyles({
cutoutIconContainer: {
position: "absolute",
right: 0,
bottom: 0
},
avatarContainer: {
position: "relative"
},
rightAccessoryContainer: {
marginLeft: RIGHT_ACCESSORY_LEFT_MARGIN
}
});
cutout = {
direction: CutoutDirection.BOTTOM_RIGHT,
radius: 10,
inset: -2
};
Component = memo(function({ message }) {
const styles = useStyles();
return useHasPreviewableMedia(message) ?
: null;
});
const r55 = memo(function ReminderNotification(props) {
const notification = props.notification;
const { savedMessage, author, channel: channel2 } = notification;
const message = savedMessage.message;
Module38(message != null, "Message in a notification should not be null.");
return } header={useMemo(() => ({
type: "simple",
text: intl.string(t.Whs8tE)
}), [])} onPress={useCallback(() => {
ModalActionCreators.popAll();
showForLaterModal(SavedMessageSortTypes.REMINDER);
AnalyticsUtils.track(AnalyticEvents.FOR_LATER_REMINDER_NOTIFICATION_CLICKED, {
message_id: notification.savedMessage.saveData.messageId,
message_author_id: notification.author.id,
notification_type: "IN_APP"
});
}, [notification])} notification={notification} rightAccessory={}>
;
});
export default r55;