Files
nonebot2/website/src/components/Form/Plugin.tsx
2025-07-01 22:27:22 +08:00

53 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from "react";
import Link from "@docusaurus/Link";
import { Form } from ".";
export default function PluginForm(): React.ReactNode {
const formItems = [
{
name: "包信息",
items: [
{ type: "text", name: "pypi", labelText: "PyPI 项目名" },
{ type: "text", name: "module", labelText: "插件模块名" },
],
},
{
name: "其他信息",
items: [{ type: "tag", name: "tags", labelText: "标签" }],
},
];
const handleSubmit = (result: Record<string, string>) => {
window.open(
`https://github.com/nonebot/nonebot2/issues/new?${new URLSearchParams({
template: "plugin_publish.yml",
title: `Plugin: ${result.pypi}`,
...result,
})}`
);
};
const description = (
<p>
{" "}
<Link
className="text-primary"
href="https://nonebot.dev/docs/developer/plugin-publishing"
>
NoneBot
</Link>
</p>
);
return (
<Form
type="plugin"
formItems={formItems}
handleSubmit={handleSubmit}
description={description}
/>
);
}