@@ -2,7 +2,7 @@ import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/Stac
22import { StackActions , useNavigation , type StaticScreenProps } from "@react-navigation/native" ;
33import type { MenuAction } from "@react-native-menu/menu" ;
44import { useCallback , useEffect , useId , useMemo , useRef , useState } from "react" ;
5- import { ActivityIndicator , Platform , View } from "react-native" ;
5+ import { Platform , View } from "react-native" ;
66import { useSafeAreaInsets } from "react-native-safe-area-context" ;
77import Svg , { Defs , LinearGradient , Rect , Stop } from "react-native-svg" ;
88import { EnvironmentId , type ProjectReadFileResult , ThreadId } from "@t3tools/contracts" ;
@@ -16,7 +16,6 @@ import { mediaFileReference } from "@t3tools/client-runtime/media-reference";
1616
1717import { AndroidHeaderIconButton , AndroidScreenHeader } from "../../components/AndroidScreenHeader" ;
1818import { MaterialScreenContent } from "../../components/MaterialScreenContent" ;
19- import { AppText as Text } from "../../components/AppText" ;
2019import { AudioFilePreview } from "../../components/AudioFilePreview" ;
2120import { ControlPillMenu } from "../../components/ControlPill" ;
2221import { EmptyState } from "../../components/EmptyState" ;
@@ -49,6 +48,7 @@ import {
4948} from "../layout/workspace-sidebar-toolbar" ;
5049import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider" ;
5150import { ThreadRouteScreen } from "../threads/ThreadRouteScreen" ;
51+ import { FilePreviewLoading , FilePreviewNotice } from "./FilePreviewFeedback" ;
5252import { FileMarkdownPreview } from "./FileMarkdownPreview" ;
5353import { FileTreeBrowser } from "./FileTreeBrowser" ;
5454import { useFileTreeEntries } from "./useFileTreeEntries" ;
@@ -161,10 +161,7 @@ function FileContent(props: {
161161
162162 if ( isAudioFile ) {
163163 return props . previewUri === null ? (
164- < View className = "flex-1 items-center justify-center gap-3 bg-sheet px-6" >
165- < ActivityIndicator />
166- < Text className = "text-center text-sm text-foreground-muted" > Loading file...</ Text >
167- </ View >
164+ < FilePreviewLoading message = "Loading file..." />
168165 ) : (
169166 < AudioFilePreview uri = { props . previewUri } onRetry = { props . onRetryPreview } />
170167 ) ;
@@ -196,25 +193,15 @@ function FileContent(props: {
196193 }
197194
198195 if ( props . fileContents === null ) {
199- return (
200- < View className = "flex-1 items-center justify-center gap-3 bg-sheet px-6" >
201- < ActivityIndicator />
202- < Text className = "text-center text-sm text-foreground-muted" > Loading file...</ Text >
203- </ View >
204- ) ;
196+ return < FilePreviewLoading message = "Loading file..." /> ;
205197 }
206198
207199 return (
208200 < View className = "flex-1 bg-sheet" >
209201 { props . truncated ? (
210- < View className = "border-b border-warning-border bg-warning px-4 py-2" >
211- < Text className = "text-2xs font-t3-bold uppercase text-warning-foreground" >
212- Partial file
213- </ Text >
214- < Text className = "text-xs leading-snug text-warning-foreground" >
215- Preview limited to the first 1 MB of a truncated file.
216- </ Text >
217- </ View >
202+ < FilePreviewNotice title = "Partial file" >
203+ Preview limited to the first 1 MB of a truncated file.
204+ </ FilePreviewNotice >
218205 ) : null }
219206 { props . activeMode === "preview" && isMarkdown ? (
220207 < FileMarkdownPreview
0 commit comments