xref: /MusicFree/src/pages/musicDetail/components/background.tsx (revision b882a19d884fffa32f7c8cef31652b909dceaa0f)
1import React from 'react';
2import {Image, StyleSheet} from 'react-native';
3import MusicQueue from '@/core/musicQueue';
4
5export default function Background() {
6    const musicItem = MusicQueue.useCurrentMusicItem();
7    return (
8        <>
9            {musicItem?.artwork && (
10                <Image
11                    style={style.blur}
12                    blurRadius={18}
13                    source={{
14                        uri: musicItem.artwork,
15                    }}
16                />
17            )}
18        </>
19    );
20}
21
22const style = StyleSheet.create({
23    blur: {
24        width: '100%',
25        height: '100%',
26        position: 'absolute',
27        top: 0,
28        left: 0,
29        right: 0,
30        bottom: 0,
31        opacity: 0.6,
32    },
33});
34