mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-24 21:55:38 +08:00
eca9a160cc
* feat: add modal component * feat: add modal component * fix: proxies page arrow button problem * fix: button radius problem * feat: add modal component * feat: add modal component --------- Signed-off-by: Alpha <61853980+AlphaGHX@users.noreply.github.com>
35 lines
862 B
TypeScript
35 lines
862 B
TypeScript
import { IconNetwork } from '@tabler/icons-solidjs'
|
|
import { Component, Show } from 'solid-js'
|
|
import { Modal } from '~/components'
|
|
import { useI18n } from '~/i18n'
|
|
import { allConnections } from '~/signals'
|
|
|
|
export const ConnectionsTableDetailsModal: Component<{
|
|
ref?: (el: HTMLDialogElement) => void
|
|
selectedConnectionID?: string
|
|
}> = (props) => {
|
|
const [t] = useI18n()
|
|
|
|
return (
|
|
<Modal
|
|
ref={(el) => props.ref?.(el)}
|
|
icon={<IconNetwork size={24} />}
|
|
title={t('connectionsDetails')}
|
|
>
|
|
<Show when={props.selectedConnectionID}>
|
|
<pre>
|
|
<code>
|
|
{JSON.stringify(
|
|
allConnections().find(
|
|
({ id }) => id === props.selectedConnectionID,
|
|
),
|
|
null,
|
|
2,
|
|
)}
|
|
</code>
|
|
</pre>
|
|
</Show>
|
|
</Modal>
|
|
)
|
|
}
|