import { Design } from '@revenge-mod/discord/design' import { useState } from 'react' import { PixelRatio, useWindowDimensions, View } from 'react-native' import { PLUGIN_CARD_ESTIMATED_SIZE } from './PluginCard' import { PluginFlashList } from './PluginList' import type { AnyPlugin } from '@revenge-mod/plugins/_' const { AlertModal, AlertActionButton, Text } = Design export default function PluginHasDependentsAlert({ plugin, dependents, action, }: { plugin: AnyPlugin dependents: AnyPlugin[] action: () => Promise }) { const { height: windowHeight } = useWindowDimensions() const maxHeight = PixelRatio.get() * windowHeight * 0.35 - 64 const [height, setHeight] = useState( PLUGIN_CARD_ESTIMATED_SIZE * dependents.length, ) return ( Other plugins depend on{' '} {plugin.manifest.name} {' '} to function. {'\n'} Disabling it will also disable the following plugins: } extraContent={ setHeight(h)} /> } actions={ <> } /> ) }