refactor: improve Kind39701 consistency and URL handling

- Match title style with article renderer (add text-foreground)
- Add https:// prefix when only d tag provided
- Maintain consistency across kind renderers
This commit is contained in:
Alejandro Gómez
2025-12-11 13:13:50 +01:00
parent ee54695fee
commit ae1a77d18e

View File

@@ -12,13 +12,16 @@ export function Kind39701Renderer({ event }: BaseEventProps) {
// URL comes from d tag (identifier) or optional u tag
const dTag = event.tags.find((t) => t[0] === "d")?.[1];
const uTag = event.tags.find((t) => t[0] === "u")?.[1];
const url = uTag || dTag;
// If only d tag provided, assume https:// prefix
const url = uTag || (dTag ? `https://${dTag}` : undefined);
return (
<BaseEventContainer event={event}>
<div className="flex flex-col gap-2">
{/* Title */}
{title && <h3 className="text-lg font-bold">{title}</h3>}
{title && (
<h3 className="text-lg font-bold text-foreground">{title}</h3>
)}
{/* URL with external link icon */}
{url && (