mirror of
https://github.com/yyhuni/xingrin.git
synced 2026-01-31 11:46:16 +08:00
feat(targets): update navigation routes and enhance add button UI
- Change target detail navigation route from `/website/` to `/overview/` - Update TargetNameCell click handler to use new overview route - Update TargetRowActions onView handler to use new overview route - Add IconPlus icon import from @tabler/icons-react - Add icon to create target button for improved visual clarity - Improves navigation consistency and button affordance in targets table
This commit is contained in:
@@ -132,7 +132,7 @@ function TargetNameCell({
|
||||
return (
|
||||
<div className="group flex items-start gap-1 flex-1 min-w-0">
|
||||
<button
|
||||
onClick={() => navigate(`/target/${targetId}/website/`)}
|
||||
onClick={() => navigate(`/target/${targetId}/overview/`)}
|
||||
className="text-sm font-medium hover:text-primary hover:underline underline-offset-2 transition-colors cursor-pointer text-left break-all leading-relaxed whitespace-normal"
|
||||
>
|
||||
{name}
|
||||
@@ -251,7 +251,7 @@ export const createTargetColumns = ({
|
||||
cell: ({ row }) => (
|
||||
<TargetRowActions
|
||||
target={row.original}
|
||||
onView={() => navigate(`/target/${row.original.id}/website/`)}
|
||||
onView={() => navigate(`/target/${row.original.id}/overview/`)}
|
||||
onDelete={() => handleDelete(row.original)}
|
||||
t={t}
|
||||
/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
import { IconSearch, IconLoader2 } from "@tabler/icons-react"
|
||||
import { IconSearch, IconLoader2, IconPlus } from "@tabler/icons-react"
|
||||
import { useTranslations } from "next-intl"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Input } from "@/components/ui/input"
|
||||
@@ -74,6 +74,7 @@ export function TargetsDataTable({
|
||||
// 自定义添加按钮(支持 onAddHover)
|
||||
const addButton = onAddNew ? (
|
||||
<Button onClick={onAddNew} onMouseEnter={onAddHover} size="sm">
|
||||
<IconPlus className="h-4 w-4" />
|
||||
{addButtonText || tTarget("createTarget")}
|
||||
</Button>
|
||||
) : undefined
|
||||
|
||||
Reference in New Issue
Block a user