1export function resolveReviewAvailability(input: {
2 readonly hasEnvironmentPresentation: boolean;
3 readonly isEnvironmentConnected: boolean;
4 readonly hasCachedSelectedDiff: boolean;
5 readonly hasAnyCachedDiff: boolean;
6}): {
7 readonly showConnectionNotice: boolean;
8 readonly showSectionToolbar: boolean;
9} {
10 const showConnectionNotice =
11 input.hasEnvironmentPresentation &&
12 !input.isEnvironmentConnected &&
13 !input.hasCachedSelectedDiff;
14
15 return {
16 showConnectionNotice,
17 showSectionToolbar: !showConnectionNotice || input.hasAnyCachedDiff,
18 };
19}