Skip to content

Commit

Permalink
feat: text-sx / add hf links
Browse files Browse the repository at this point in the history
  • Loading branch information
zhzLuke96 committed Nov 23, 2024
1 parent 6593689 commit 7660a21
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,24 @@ function EnhancedTable({ data }: EnhancedTableProps) {
.split("_")
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(" "),
cell: (info) => info.getValue(),
cell: (info) => {
if (key === "model") {
// 如果是model,就尝试创建 huggingface 链接
const val = info.getValue();
if (typeof val === "string" && val.match(/.+?\/.+?/)) {
return (
<a
className="underline"
href={`https://huggingface.co/${val}`}
target="_blank"
>
{val}
</a>
);
}
}
return info.getValue();
},
enableSorting: true,
// enableFiltering: true,
});
Expand Down Expand Up @@ -176,7 +193,7 @@ function EnhancedTable({ data }: EnhancedTableProps) {
}

return (
<div className="p-2 flex flex-col flex-1 overflow-hidden">
<div className="p-2 flex flex-col flex-1 overflow-hidden text-xs">
{/* 全局搜索 */}
<div className="mb-4">
<DebouncedInput
Expand Down

0 comments on commit 7660a21

Please sign in to comment.