paper-ai-release-24-07-21/components/SettingsLink.tsx

43 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-01-21 23:08:25 +08:00
"use client";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faCog } from "@fortawesome/free-solid-svg-icons";
2024-02-03 23:07:02 +08:00
import React, { useState } from "react";
2024-01-21 23:08:25 +08:00
import Link from "next/link";
2024-02-07 16:12:40 +08:00
import SettingsWrapper from "@/components/SettingsWrapper";
2024-01-21 23:08:25 +08:00
const SettingsLink = () => {
2024-02-03 23:07:02 +08:00
const [isVisible, setIsVisible] = useState(false);
// 提取的处理函数
const toggleVisibility = () => {
setIsVisible((prevIsVisible) => !prevIsVisible);
console.log("isVisible", isVisible);
};
2024-01-21 23:08:25 +08:00
return (
2024-02-03 23:07:02 +08:00
// <>
// {/* 使用FontAwesomeIcon图标作为按钮 */}
// <FontAwesomeIcon icon={faCog} size="2x" onClick={toggleVisibility} />
// {/* 根据isVisible状态展示或隐藏组件 */}
// <div
// className={`component-container ${
// isVisible ? "animate-slide-in-right" : ""
// }`}
// >
2024-02-07 16:12:40 +08:00
// <SettingsWrapper />
2024-02-03 23:07:02 +08:00
// </div>
// </>
2024-01-21 23:08:25 +08:00
<Link href="/settings" aria-label="Settings">
2024-02-11 11:34:57 +08:00
<FontAwesomeIcon icon={faCog} size="2x" className="icon-hover" />
2024-01-21 23:08:25 +08:00
</Link>
);
};
export default SettingsLink;
2024-02-03 23:07:02 +08:00
// <Link href="/settings" aria-label="Settings">
// <FontAwesomeIcon icon={faCog} size="2x" />
// </Link>;