mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-10-29 08:04:53 +00:00
feat(canvas): brand tech icons on services, matching site preview
Resolve a service's tech (postgres, redis, go, node, nginx, kafka, ~50 slugs) from its image/name and render the Simple Icons logo in the tinted icon tile — canvas nodes, inspector, service detail header, and database rows — with graceful fallback to type icons. Demo services get resolvable images, ports, and domains; a Redis Cache service joins Core Platform so the demo canvas mirrors the landing preview (5 services, web/api/worker → api → postgres/redis). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
e57f0470eb
commit
1425618c92
7 files changed
+180
-31
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { useState } from 'react';
|
||||
import { serviceIcon, serviceIconUrl, serviceTypeIcon, type ServiceIconInput } from './service-visuals';
|
||||
|
||||
export function ServiceIcon({
|
||||
service,
|
||||
size = 16,
|
||||
}: {
|
||||
service: ServiceIconInput;
|
||||
size?: number;
|
||||
}) {
|
||||
const [failed, setFailed] = useState(false);
|
||||
const brand = serviceIcon(service);
|
||||
if (brand && !failed) {
|
||||
return (
|
||||
<img
|
||||
src={serviceIconUrl(brand)}
|
||||
width={size}
|
||||
height={size}
|
||||
alt=""
|
||||
loading="lazy"
|
||||
onError={() => setFailed(true)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return serviceTypeIcon(service.type ?? 'service', size);
|
||||
}
|
||||
Reference in new issue
Block a user