feat: enhance table with new translations and tooltip for descriptions (#2471)

This commit is contained in:
Konv Suu 2025-01-06 14:13:20 +08:00 committed by GitHub
parent b4edc426df
commit 99011ebcf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 6 deletions

View File

@ -8,6 +8,7 @@ import {
TableHeader,
TableRow,
} from "@follow/components/ui/table/index.jsx"
import { EllipsisTextWithTooltip } from "@follow/components/ui/typography/index.js"
import type { RSSHubModel } from "@follow/models"
import { useTranslation } from "react-i18next"
@ -68,7 +69,7 @@ function List({ data }: { data?: RSSHubModel[] }) {
<Table containerClassName="mt-2 overflow-x-auto">
<TableHeader>
<TableRow>
<TableHead className="w-[50px] font-bold" size="sm" />
<TableHead className="font-bold" size="sm" />
<TableHead className="w-[150px] font-bold" size="sm">
{t("rsshub.table.owner")}
</TableHead>
@ -89,7 +90,7 @@ function List({ data }: { data?: RSSHubModel[] }) {
</TableHeader>
<TableBody className="border-t-[12px] border-transparent [&_td]:!px-3">
<TableRow>
<TableCell className="font-bold">Official</TableCell>
<TableCell className="text-nowrap font-bold">{t("rsshub.table.official")}</TableCell>
<TableCell>
<span className="flex items-center gap-2">
<Logo className="size-6" />
@ -120,14 +121,14 @@ function List({ data }: { data?: RSSHubModel[] }) {
{data?.map((instance) => {
return (
<TableRow key={instance.id}>
<TableCell>
<TableCell className="text-nowrap">
{(() => {
const flag: string[] = []
if (status?.data?.usage?.rsshubId === instance.id) {
flag.push("In use")
flag.push(t("rsshub.table.inuse"))
}
if (instance.ownerUserId === me?.id) {
flag.push("Yours")
flag.push(t("rsshub.table.yours"))
}
return flag.join(" / ")
})()}
@ -140,7 +141,9 @@ function List({ data }: { data?: RSSHubModel[] }) {
/>
</TableCell>
<TableCell>
<div className="line-clamp-2">{instance.description}</div>
<EllipsisTextWithTooltip className="line-clamp-2">
{instance.description}
</EllipsisTextWithTooltip>
</TableCell>
<TableCell>
<span className="flex items-center justify-end gap-1">

View File

@ -300,12 +300,14 @@
"rsshub.table.description": "Description",
"rsshub.table.edit": "Edit",
"rsshub.table.inuse": "In Use",
"rsshub.table.official": "Official",
"rsshub.table.owner": "Owner",
"rsshub.table.price": "Monthly Price",
"rsshub.table.unlimited": "Unlimited",
"rsshub.table.use": "Use",
"rsshub.table.userCount": "User Count",
"rsshub.table.userLimit": "User Limit",
"rsshub.table.yours": "Yours",
"rsshub.useModal.about": "About this Instance",
"rsshub.useModal.month": "month",
"rsshub.useModal.months_label": "The number of months you want to purchase",

View File

@ -300,12 +300,14 @@
"rsshub.table.description": "描述",
"rsshub.table.edit": "编辑",
"rsshub.table.inuse": "使用中",
"rsshub.table.official": "官方",
"rsshub.table.owner": "所有者",
"rsshub.table.price": "月度价格",
"rsshub.table.unlimited": "无限制",
"rsshub.table.use": "使用",
"rsshub.table.userCount": "用户数量",
"rsshub.table.userLimit": "用户限制",
"rsshub.table.yours": "你的",
"rsshub.useModal.about": "关于此实例",
"rsshub.useModal.month": "个月",
"rsshub.useModal.months_label": "你想购买的月份数量",