新建信件按钮

This commit is contained in:
Li1304553726 2025-12-01 11:43:34 +08:00
parent 78514cb093
commit 7170501f59
2 changed files with 21 additions and 9 deletions

View File

@ -1,10 +1,14 @@
import { Button } from "antd";
import { useNavigate } from "react-router-dom";
export function Header() {
const navigate = useNavigate();
return (
<header className="bg-gradient-to-r from-primary-500/80 to-primary-400 p-6 rounded-t-xl">
<div className="flex flex-col space-y-6">
{/* 主标题区域 */}
<div>
<h1 className="text-3xl font-bold tracking-wider text-white">
<div className="flex items-center justify-between ">
<h1 className="text-3xl font-bold tracking-wider text-white m-0">
</h1>
{/* <p className="mt-2 text-blue-100 text-lg">

View File

@ -1,11 +1,12 @@
import { useState, useEffect, useMemo } from "react";
import { Input, Pagination, Empty, Spin, Radio, Space, Tag } from "antd";
import { Input, Pagination, Empty, Spin, Radio, Space, Tag, Button } from "antd";
import { api, RouterInputs } from "@nice/client";
import { LetterCard } from "../LetterCard";
import { NonVoid } from "@nice/utils";
import { SearchOutlined, FilterOutlined } from "@ant-design/icons";
import debounce from "lodash/debounce";
import { postDetailSelect } from "@nice/common";
import { useNavigate } from "react-router-dom";
export default function LetterList({
params,
@ -17,7 +18,7 @@ export default function LetterList({
const [keyword, setKeyword] = useState<string | undefined>("");
const [currentPage, setCurrentPage] = useState(1);
const [selectedCategory, setSelectedCategory] = useState<string>("all");
const navigate = useNavigate();
const { data: categoriesData } = api.term.findMany.useQuery({
where: {
taxonomy: {
@ -56,12 +57,12 @@ export default function LetterList({
],
...(selectedCategory !== "all"
? {
terms: {
some: {
id: selectedCategory,
},
terms: {
some: {
id: selectedCategory,
},
}
},
}
: {}),
...params?.where,
},
@ -124,6 +125,13 @@ export default function LetterList({
</Radio.Button>
))}
</Radio.Group>
<Button
type="primary"
size="large"
onClick={() => navigate("/editor")}
className="flex items-center justify-center">
</Button>
</div>
<Space direction="vertical" className="w-full" size="middle">