37 lines
1.6 KiB
TypeScript
37 lines
1.6 KiB
TypeScript
// Metro module 12013 (f12014).
|
|
import { useCallback } from "react";
|
|
import ContentInventoryOutboxStore from "../../content_inventory/ContentInventoryOutboxStore";
|
|
import { useUserProfileAnalyticsContext } from "../UserProfileAnalyticsContext";
|
|
import useAnalyticsLocations from "../../app_analytics/useAnalyticsLocations";
|
|
import { useStateFromStores } from "../../../_bundle/Module589";
|
|
import { trackUserProfileActivityAction } from "../UserProfileAnalyticsUtils";
|
|
export default function useTrackUserProfileActivityAction(a0) {
|
|
const { user, display, activity, entry, stream, voiceChannelId } = a0;
|
|
let analyticsLocations2 = a0.analyticsLocations;
|
|
const userProfileAnalyticsContext = useUserProfileAnalyticsContext();
|
|
const { context, trackUserProfileAction } = userProfileAnalyticsContext;
|
|
const analyticsLocations3 = useAnalyticsLocations().analyticsLocations;
|
|
if (analyticsLocations2 == null) {
|
|
analyticsLocations2 = analyticsLocations3;
|
|
}
|
|
const analyticsLocations = analyticsLocations2;
|
|
const stateFromStores = useStateFromStores([ContentInventoryOutboxStore], () => ContentInventoryOutboxStore.getUserOutbox(user.id));
|
|
return useCallback(({ action }) => {
|
|
trackUserProfileAction({
|
|
action,
|
|
analyticsLocations
|
|
});
|
|
trackUserProfileActivityAction({
|
|
action,
|
|
display,
|
|
activity,
|
|
entry,
|
|
stream,
|
|
outbox: stateFromStores,
|
|
voiceChannelId,
|
|
analyticsLocations,
|
|
...context
|
|
});
|
|
}, [trackUserProfileAction, context, display, activity, stream, entry, stateFromStores, voiceChannelId, analyticsLocations]);
|
|
};
|