mirror of
https://github.com/henrygd/beszel.git
synced 2026-03-21 21:26:16 +01:00
feat: add tooltip to system name in systems table for better accessibility (#1640)
This commit is contained in:
@@ -129,20 +129,27 @@ export function SystemsTableColumns(viewMode: "table" | "grid"): ColumnDef<Syste
|
|||||||
const { name, id } = info.row.original
|
const { name, id } = info.row.original
|
||||||
const longestName = useStore($longestSystemNameLen)
|
const longestName = useStore($longestSystemNameLen)
|
||||||
return (
|
return (
|
||||||
<>
|
<Tooltip>
|
||||||
<span className="flex gap-2 items-center font-medium text-sm text-nowrap md:ps-1">
|
<TooltipTrigger asChild>
|
||||||
<IndicatorDot system={info.row.original} />
|
<div className="relative">
|
||||||
{/* NOTE: change to 1 ch if switching to monospace font */}
|
<span className="flex gap-2 items-center font-medium text-sm text-nowrap md:ps-1">
|
||||||
<span className="truncate" style={{ width: `${longestName / 1.1}ch` }}>
|
<IndicatorDot system={info.row.original} />
|
||||||
{name}
|
{/* NOTE: change to 1 ch if switching to monospace font */}
|
||||||
</span>
|
<span className="truncate" style={{ width: `${longestName / 1.1}ch` }}>
|
||||||
</span>
|
{name}
|
||||||
<Link
|
</span>
|
||||||
href={getPagePath($router, "system", { id })}
|
</span>
|
||||||
className="inset-0 absolute size-full"
|
<Link
|
||||||
aria-label={name}
|
href={getPagePath($router, "system", { id })}
|
||||||
></Link>
|
className="inset-0 absolute size-full"
|
||||||
</>
|
aria-label={name}
|
||||||
|
></Link>
|
||||||
|
</div>
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent>
|
||||||
|
<p>{name}</p>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
header: sortableHeader,
|
header: sortableHeader,
|
||||||
|
|||||||
Reference in New Issue
Block a user