mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 12:25:22 +00:00
tooltip for commit hash
This commit is contained in:
parent
f76fd0c6c4
commit
c16ef08a7c
1 changed files with 19 additions and 5 deletions
|
|
@ -36,6 +36,7 @@ import { getBrowsePath } from "../../browse/hooks/utils"
|
||||||
import { useRouter } from "next/navigation"
|
import { useRouter } from "next/navigation"
|
||||||
import { useToast } from "@/components/hooks/use-toast";
|
import { useToast } from "@/components/hooks/use-toast";
|
||||||
import { DisplayDate } from "../../components/DisplayDate"
|
import { DisplayDate } from "../../components/DisplayDate"
|
||||||
|
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"
|
||||||
|
|
||||||
// @see: https://v0.app/chat/repo-indexing-status-uhjdDim8OUS
|
// @see: https://v0.app/chat/repo-indexing-status-uhjdDim8OUS
|
||||||
|
|
||||||
|
|
@ -174,16 +175,29 @@ export const columns: ColumnDef<Repo>[] = [
|
||||||
commitHash: hash,
|
commitHash: hash,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!commitUrl) {
|
const HashComponent = commitUrl ? (
|
||||||
return <span className="font-mono text-sm">{smallHash}</span>
|
<Link
|
||||||
}
|
|
||||||
|
|
||||||
return <Link
|
|
||||||
href={commitUrl}
|
href={commitUrl}
|
||||||
className="font-mono text-sm text-link hover:underline"
|
className="font-mono text-sm text-link hover:underline"
|
||||||
>
|
>
|
||||||
{smallHash}
|
{smallHash}
|
||||||
</Link>
|
</Link>
|
||||||
|
) : (
|
||||||
|
<span className="font-mono text-sm text-muted-foreground">
|
||||||
|
{smallHash}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger asChild>
|
||||||
|
{HashComponent}
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent>
|
||||||
|
<span className="font-mono">{hash}</span>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue