fix(frontend): remove dead activeTab state; guard URL hostname parse

This commit is contained in:
2026-05-15 20:21:05 +02:00
parent c1c9539978
commit 448cd506eb
2 changed files with 8 additions and 4 deletions

View File

@@ -12,6 +12,13 @@ interface ProfileCardProps {
}
export function ProfileCard({ actor, action }: ProfileCardProps) {
let hostname: string | null = null;
try {
if (actor.url) hostname = new URL(actor.url).hostname;
} catch {
hostname = actor.url;
}
return (
<>
<div className="flex justify-between items-start">
@@ -47,7 +54,7 @@ export function ProfileCard({ actor, action }: ProfileCardProps) {
className="flex items-center overflow-hidden"
>
<ExternalLink className="mr-2 h-4 w-4 shrink-0" />
<span className="truncate">{new URL(actor.url).hostname}</span>
<span className="truncate">{hostname}</span>
</Link>
</Button>