Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 31 additions & 8 deletions src/components/PageHeader/PageHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { Box, Typography, Button, Menu, MenuItem } from "@mui/material";
import {
Box,
Typography,
Button,
Menu,
MenuItem,
IconButton,
} from "@mui/material";
import { useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import useUserStore from "@stores/useUserStore";
import AccountCircleIcon from "@mui/icons-material/AccountCircle";
import ArrowBackIcon from "@mui/icons-material/ArrowBackIos";

interface PageHeaderProps {
title: string;
Expand Down Expand Up @@ -46,13 +54,28 @@ const PageHeader = ({ title, userName, action }: PageHeaderProps) => {
boxShadow: "0px 2px 4px rgba(0, 0, 0, 0.05)",
}}
>
<Typography
variant="h5"
component="h1"
sx={{ fontWeight: "bold", color: "#222222" }}
>
{title}
</Typography>
<Box sx={{ display: "flex", alignItems: "center", gap: 2 }}>
{
<IconButton
onClick={() => navigate(-1)}
sx={{
color: "#164F9E",
"&:hover": {
backgroundColor: "rgba(22, 79, 158, 0.04)",
},
}}
>
<ArrowBackIcon />
</IconButton>
}
Comment on lines +58 to +70
Copy link

Copilot AI May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Remove the unnecessary JSX curly braces that wrap the IconButton since the component is always rendered.

Suggested change
{
<IconButton
onClick={() => navigate(-1)}
sx={{
color: "#164F9E",
"&:hover": {
backgroundColor: "rgba(22, 79, 158, 0.04)",
},
}}
>
<ArrowBackIcon />
</IconButton>
}
<IconButton
onClick={() => navigate(-1)}
sx={{
color: "#164F9E",
"&:hover": {
backgroundColor: "rgba(22, 79, 158, 0.04)",
},
}}
>
<ArrowBackIcon />
</IconButton>

Copilot uses AI. Check for mistakes.
<Typography
variant="h5"
component="h1"
sx={{ fontWeight: "bold", color: "#222222" }}
>
{title}
</Typography>
</Box>

<Box sx={{ display: "flex", alignItems: "center", gap: 2 }}>
{action}
Expand Down