Files
qna-viewer-react/viewer/src/components/Header.tsx
Lectom C Han 466d719eef 1 - feat(dynamic-table): 컬럼 너비 조절 및 고정 기능 추가
3 - 사용자가 직접 컬럼의 너비를 조절할 수 있도록 리사이즈 핸들러를 추가
   4 - '생성일'과 '수정일' 컬럼의 너비를 120px로 고정하여 가독성을 높임   5 - 리사이즈 핸들러가 올바르게 표시되도록 관련 CSS 스타일을 추가했습니다.
2025-08-04 00:40:14 +09:00

72 lines
1.9 KiB
TypeScript

import { cn } from "@/lib/utils";
import { NavLink } from "react-router-dom";
import { ProjectSelectBox } from "./ProjectSelectBox";
import { ThemeSelectBox } from "./ThemeSelectBox";
import { LanguageSelectBox } from "./LanguageSelectBox";
import { UserProfileBox } from "./UserProfileBox";
import { useSettingsStore } from "@/store/useSettingsStore";
import Logo from "@/assets/react.svg";
const menuItems = [
{ name: "Feedback", path: "/feedbacks", type: "feedback" },
{ name: "Issue", path: "/issues", type: "issue" },
];
interface HeaderProps {
className?: string;
}
export function Header({ className }: HeaderProps) {
const { projectId, channelId } = useSettingsStore();
const getPath = (type: string, basePath: string) => {
if (type === "issue") {
return `/projects/${projectId}${basePath}`;
}
return `/projects/${projectId}/channels/${channelId}${basePath}`;
};
const homePath = `/projects/${projectId}`;
return (
<header className={cn("border-b", className)}>
<div className="container mx-auto flex h-16 items-center">
{/* Left Section */}
<div className="flex items-center gap-6">
<NavLink to={homePath} className="flex items-center gap-2">
<img src={Logo} alt="Logo" className="h-8 w-auto" />
</NavLink>
<ProjectSelectBox />
</div>
{/* Middle Navigation */}
<nav className="mx-8 flex items-center space-x-4 lg:space-x-6">
{menuItems.map((item) => (
<NavLink
key={item.name}
to={getPath(item.type, item.path)}
className={({ isActive }) =>
`text-base transition-colors hover:text-primary ${
isActive
? "font-bold text-primary"
: "font-medium text-muted-foreground"
}`
}
>
{item.name}
</NavLink>
))}
</nav>
{/* Right Section */}
<div className="ml-auto flex items-center gap-4">
<ThemeSelectBox />
<LanguageSelectBox />
<UserProfileBox />
</div>
</div>
</header>
);
}