xref: /MusicFree/src/components/dialogs/index.tsx (revision 443caf223905f46d4a33476b5979baa3715e5352)
1bf6e62f2S猫头猫import React from 'react';
2bf6e62f2S猫头猫import {Portal} from 'react-native-paper';
3caaa811bS猫头猫import components from './components';
4*443caf22S猫头猫import {dialogInfoStore} from './useDialog';
5bf6e62f2S猫头猫
64060c00aS猫头猫export default function () {
7*443caf22S猫头猫    const dialogInfoState = dialogInfoStore.useValue();
8*443caf22S猫头猫
9*443caf22S猫头猫    const Component = dialogInfoState.name
10*443caf22S猫头猫        ? components[dialogInfoState.name]
11*443caf22S猫头猫        : null;
1294a1b1fcS猫头猫
13bf6e62f2S猫头猫    return (
14bf6e62f2S猫头猫        <Portal>
15*443caf22S猫头猫            {Component ? (
16*443caf22S猫头猫                <Component {...(dialogInfoState.payload ?? {})} />
17*443caf22S猫头猫            ) : null}
18bf6e62f2S猫头猫        </Portal>
19bf6e62f2S猫头猫    );
20bf6e62f2S猫头猫}
21