metacubexd/src/components/ConnectionsTableDetailsModal.tsx

35 lines
861 B
TypeScript
Raw Normal View History

import { IconNetwork } from '@tabler/icons-solidjs'
2024-04-16 17:52:44 +08:00
import type { Component } from 'solid-js'
import { Modal } from '~/components'
import { useI18n } from '~/i18n'
2023-09-10 17:55:53 +08:00
import { allConnections } from '~/signals'
export const ConnectionsTableDetailsModal: Component<{
ref?: (el: HTMLDialogElement) => void
2023-09-10 17:55:53 +08:00
selectedConnectionID?: string
}> = (props) => {
const [t] = useI18n()
2023-09-10 17:55:53 +08:00
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>
2023-09-10 17:55:53 +08:00
)
}