Files
t3code/apps/mobile/src/features/review/reviewPaneSelection.ts
2026-07-02 22:42:14 -07:00

17 lines
538 B
TypeScript

export interface ReviewPaneFileSelection {
readonly sectionId: string | null;
readonly fileId: string | null;
}
export function resolveSelectedReviewFileId(input: {
readonly selection: ReviewPaneFileSelection;
readonly sectionId: string | null;
readonly availableFileIds: ReadonlyArray<string>;
}): string | null {
if (input.selection.sectionId !== input.sectionId || input.selection.fileId === null) {
return null;
}
return input.availableFileIds.includes(input.selection.fileId) ? input.selection.fileId : null;
}