Skip to content

Commit

Permalink
fix: sonar cloud issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bakaqc committed Feb 8, 2025
1 parent d2cbf22 commit fefdd69
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
22 changes: 1 addition & 21 deletions src/components/commons/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
PiUserCircleDuotone,
} from 'react-icons/pi';

import MenuItem from '@/components/commons/MenuItem';
import { Button } from '@/components/ui/button';
import {
DropdownMenu,
Expand Down Expand Up @@ -58,27 +59,6 @@ export const Header = () => {
{ label: 'Sign Out', icon: PiArrowCircleRightDuotone, action: signOut },
];

const MenuItem = ({
label,
icon: Icon,
action,
}: {
label: string;
icon: React.ComponentType<{
className?: string;
style?: React.CSSProperties;
}>;
action: () => void;
}) => (
<DropdownMenuItem onClick={action} className="text-base">
<Icon
className="text-orange-500"
style={{ width: '2rem', height: '2rem' }}
/>
{label}
</DropdownMenuItem>
);

return (
<div className="flex flex-col justify-center items-center sticky top-0 z-50 bg-neutral-800">
<nav
Expand Down
24 changes: 24 additions & 0 deletions src/components/commons/MenuItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';

import { DropdownMenuItem } from '@/components/ui/dropdown-menu';

interface MenuItemProps {
label: string;
icon: React.ComponentType<{
className?: string;
style?: React.CSSProperties;
}>;
action: () => void;
}

const MenuItem: React.FC<MenuItemProps> = ({ label, icon: Icon, action }) => (
<DropdownMenuItem onClick={action} className="text-base">
<Icon
className="text-orange-500"
style={{ width: '2rem', height: '2rem' }}
/>
{label}
</DropdownMenuItem>
);

export default MenuItem;

0 comments on commit fefdd69

Please sign in to comment.