Skip to content

Modern Docker Management, Designed for Everyone

1.0 KB
Raw Blame
<script lang="ts">
	import * as Card from '#lib/components/ui/card/index.js';
	import { CopyButton } from '#lib/components/ui/copy-button/index.js';
	import { CodeIcon } from '#lib/icons/index.js';
	import { m } from '#lib/paraglide/messages.js';
	import type { ContainerDetailsDto } from '#lib/types/docker.js';

	interface Props {
		container: ContainerDetailsDto;
	}

	let { container }: Props = $props();

	const json = $derived(JSON.stringify(container, null, 2));
</script>

<Card.Root>
	<Card.Header icon={CodeIcon}>
		<div class="flex flex-col space-y-1.5">
			<Card.Title>
				<h2>{m.containers_inspect_title()}</h2>
			</Card.Title>
			<Card.Description>{m.containers_inspect_description()}</Card.Description>
		</div>
		<div class="ml-auto">
			<CopyButton text={json} variant="outline" size="default">
				{m.common_copy_json()}
			</CopyButton>
		</div>
	</Card.Header>
	<div>
		<pre class="overflow-auto rounded-b-lg bg-muted/40 p-4 font-mono text-xs leading-relaxed"><code>{json}</code></pre>
	</div>
</Card.Root>