m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-11 14:43:49 -05:00

feat: detect image url from label

This commit is contained in:
Sergio
2025-03-11 17:06:00 +02:00
parent a5a1f12899
commit a599d4e084
8 changed files with 28 additions and 5 deletions

View File

@@ -40,7 +40,9 @@ export default function Image({ data }: { data: Image }) {
: data.reference;
const info = getInfo(data)!;
let url: string | null = null;
if (clickable_registries.includes(data.parts.registry)) {
if (data.url) {
url = data.url;
} else if (clickable_registries.includes(data.parts.registry)) {
switch (data.parts.registry) {
case "registry-1.docker.io":
url = `https://hub.docker.com/r/${data.parts.repository}`;
@@ -82,7 +84,7 @@ export default function Image({ data }: { data: Image }) {
>
<div className="mb-4 flex items-center gap-3">
<Box className={`size-6 shrink-0 text-${theme}-500`} />
<DialogTitle className="font-mono text-black dark:text-white break-all">
<DialogTitle className="break-all font-mono text-black dark:text-white">
{url ? (
<>
<a