+ {/* Tab bar */}
+
+ {mdFiles.map((file) => (
+
+ ))}
+
+
+ {/* Content */}
+ {selectedFile && (
+
+
+
+ )}
+
+ );
+}
+
+function MarkdownFileContent({
+ owner,
+ repo,
+ path,
+ currentRef,
+ scope,
+}: {
+ owner: string;
+ repo: string;
+ path: string;
+ currentRef: string;
+ scope: GitHubQueryScope;
+}) {
+ const contentQuery = useQuery({
+ ...githubRepoFileContentQueryOptions(scope, {
+ owner,
+ repo,
+ ref: currentRef,
+ path,
+ }),
+ placeholderData: keepPreviousData,
+ });
+
+ if (contentQuery.isLoading) {
+ return (
+