metacubexd/src/components/ConnectionsTableDetailsModal.tsx
Alpha eca9a160cc
feat(modals): add modal component (#268)
* 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>
2023-09-23 20:24:43 +08:00

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>
)
}