refactor: Center truncate deployment provider URL (#12579)

* changed Deployment Provider URL to truncate in the center

* fix: center-truncate deployment provider URL using provider_data.url

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Jordan Frazier <122494242+jordanrfrazier@users.noreply.github.com>
This commit is contained in:
a-effort
2026-04-15 14:11:18 -07:00
committed by GitHub
parent 9d14d3b34e
commit 4f9bd2bcf4

View File

@ -24,6 +24,12 @@ interface ProvidersTableProps {
onDeleteProvider?: (provider: ProviderAccount) => void;
}
function truncateMiddle(text: string, maxLength = 50): string {
if (text.length <= maxLength) return text;
const half = Math.floor((maxLength - 3) / 2);
return `${text.slice(0, half)}...${text.slice(-half)}`;
}
function formatDate(iso: string | null) {
if (!iso) return "—";
return new Date(iso).toLocaleDateString(undefined, {
@ -62,9 +68,9 @@ export default function ProvidersTable({
<span className="font-medium">{provider.name}</span>
</TableCell>
<TableCell>
<span className="max-w-[300px] truncate text-sm text-muted-foreground">
<span className="text-sm text-muted-foreground">
{typeof provider.provider_data?.url === "string"
? provider.provider_data.url
? truncateMiddle(provider.provider_data.url)
: "—"}
</span>
</TableCell>