podman-desktop/packages/renderer/src/lib/configmaps-secrets/ConfigMapSecretColumnName.svelte
Philippe Martin bb1c3c0fbd
chore: enable the @typescript-eslint/explicit-function-return-type for renderer part (#10705)
* fix: eslint config
Signed-off-by: Philippe Martin <phmartin@redhat.com>

* fix: components
Signed-off-by: Philippe Martin <phmartin@redhat.com>

* fix: store
Signed-off-by: Philippe Martin <phmartin@redhat.com>

* fix: window mocks
Signed-off-by: Philippe Martin <phmartin@redhat.com>

* fix: components 2/x
Signed-off-by: Philippe Martin <phmartin@redhat.com>

* fix: components 3/x
Signed-off-by: Philippe Martin <phmartin@redhat.com>

* fix: rebase
Signed-off-by: Philippe Martin <phmartin@redhat.com>

* fix: components 5/x
Signed-off-by: Philippe Martin <phmartin@redhat.com>

* fix: components 6/x
Signed-off-by: Philippe Martin <phmartin@redhat.com>

* fix: typo
Signed-off-by: Philippe Martin <phmartin@redhat.com>

* fix: rebase
Signed-off-by: Philippe Martin <phmartin@redhat.com>
2025-01-20 14:30:31 +01:00

34 lines
1.1 KiB
Svelte

<script lang="ts">
import { router } from 'tinro';
import { ConfigMapSecretUtils } from './configmap-secret-utils';
import type { ConfigMapSecretUI } from './ConfigMapSecretUI';
export let object: ConfigMapSecretUI;
function openDetails(): void {
const configmapSecretUtils = new ConfigMapSecretUtils();
if (configmapSecretUtils.isSecret(object)) {
router.goto(
`/kubernetes/configmapsSecrets/secret/${encodeURI(object.name)}/${encodeURI(object.namespace)}/summary`,
);
}
if (configmapSecretUtils.isConfigMap(object)) {
router.goto(
`/kubernetes/configmapsSecrets/configmap/${encodeURI(object.name)}/${encodeURI(object.namespace)}/summary`,
);
}
}
</script>
<button class="hover:cursor-pointer flex flex-col max-w-full" on:click={openDetails}>
<div class="text-sm text-[var(--pd-table-body-text-highlight)] max-w-full overflow-hidden text-ellipsis">
{object.name}
</div>
<div class="flex flex-row text-sm gap-1">
{#if object.namespace}
<div class="font-extra-light text-[var(--pd-table-body-text)]">{object.namespace}</div>
{/if}
</div>
</button>