Bluesky app fork with some witchin' additions 馃挮
witchsky.app
bluesky
fork
client
1import {StyleSheet, View} from 'react-native'
2
3import {usePalette} from '#/lib/hooks/usePalette'
4import {InfoCircleIcon} from '#/lib/icons'
5import {Text} from '#/view/com/util/text/Text'
6import {atoms as a, useTheme} from '#/alf'
7import {Loader} from '#/components/Loader'
8
9export function PostPlaceholder({
10 children,
11 directFetchEnabled,
12}: {
13 children: React.ReactNode
14 directFetchEnabled?: boolean
15}) {
16 const t = useTheme()
17 const pal = usePalette('default')
18 return (
19 <View
20 style={[styles.errorContainer, a.border, t.atoms.border_contrast_low]}>
21 {directFetchEnabled ? (
22 <Loader size={'md'} style={pal.text} />
23 ) : (
24 <InfoCircleIcon size={18} style={pal.text} />
25 )}
26 <Text type="lg" style={pal.text}>
27 {children}
28 </Text>
29 </View>
30 )
31}
32
33const styles = StyleSheet.create({
34 errorContainer: {
35 flexDirection: 'row',
36 alignItems: 'center',
37 gap: 4,
38 borderRadius: 8,
39 marginTop: 8,
40 paddingVertical: 14,
41 paddingHorizontal: 14,
42 borderWidth: StyleSheet.hairlineWidth,
43 },
44})