diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-07-12 14:55:19 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-07-12 16:23:37 +0900 |
| commit | 1c73c999ac78d2e6d3a8c68b4e17058046326f55 (patch) | |
| tree | 41a01cc3827098dfc8d108e5b9cfac1fd5e7fb7f /frontend/src/components/MenuItem.tsx | |
| parent | 9da56e3023af305ba7c5fd49caab60ac8bb57100 (diff) | |
| download | feedaka-1c73c999ac78d2e6d3a8c68b4e17058046326f55.tar.gz feedaka-1c73c999ac78d2e6d3a8c68b4e17058046326f55.tar.zst feedaka-1c73c999ac78d2e6d3a8c68b4e17058046326f55.zip | |
feat(frontend): create pages and components
Diffstat (limited to 'frontend/src/components/MenuItem.tsx')
| -rw-r--r-- | frontend/src/components/MenuItem.tsx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/frontend/src/components/MenuItem.tsx b/frontend/src/components/MenuItem.tsx new file mode 100644 index 0000000..45358c8 --- /dev/null +++ b/frontend/src/components/MenuItem.tsx @@ -0,0 +1,28 @@ +import type { IconDefinition } from "@fortawesome/fontawesome-svg-core"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { Link, useLocation } from "wouter"; + +interface Props { + path: string; + label: string; + icon: IconDefinition; +} + +export function MenuItem({ path, label, icon }: Props) { + const [location] = useLocation(); + const isActive = location === path; + + return ( + <Link + href={path} + className={`flex items-center space-x-2 px-3 py-2 rounded-md text-sm font-medium transition-colors ${ + isActive + ? "bg-blue-100 text-blue-700" + : "text-gray-600 hover:text-gray-900 hover:bg-gray-100" + }`} + > + <FontAwesomeIcon icon={icon} /> + <span>{label}</span> + </Link> + ); +} |
