xref: /MusicFree/src/components/base/fastImage.tsx (revision 1574be2be30dccf99989a1912b89911f5d39b100)
1import React from 'react';
2import {StyleSheet, Text, View} from 'react-native';
3import rpx from '@/utils/rpx';
4import FastImage, {FastImageProps} from 'react-native-fast-image';
5
6interface IFastImageProps {
7  style: FastImageProps['style'];
8  defaultSource?: FastImageProps['defaultSource'];
9  emptySrc?: number;
10  uri?: string;
11}
12export default function (props: IFastImageProps) {
13  const {style, emptySrc, uri, defaultSource} = props ?? {};
14  const source = uri
15    ? {
16        uri,
17      }
18    : emptySrc;
19  return (
20    <FastImage
21      style={style}
22      source={source}
23      defaultSource={defaultSource}></FastImage>
24  );
25}
26
27const style = StyleSheet.create({
28  wrapper: {
29    width: rpx(750),
30  },
31});
32