Skip to content

Commit

Permalink
feat(component): replaced -> component (#15055)
Browse files Browse the repository at this point in the history
Co-authored-by: Taylor Jones <tay1orjones@users.noreply.github.com>
  • Loading branch information
Nirajsah and tay1orjones authored Oct 31, 2023
1 parent bc963fa commit a9d5608
Showing 1 changed file with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,37 @@ import PropTypes from 'prop-types';
import React from 'react';
import { usePrefix } from '../../internal/usePrefix';

function SideNavItem({ className: customClassName, children, large = false }) {
interface SideNavItemProps {
/**
* Provide a single icon as the child to `SideNavItem` to render in the
* container
*/
children: React.ReactNode;

/**
* Provide an optional class to be applied to the containing node
*/
className?: string;

/**
* Specify if this is a large variation of the SideNavItem
*/
large?: boolean;
}

const SideNavItem: React.FC<SideNavItemProps> = ({
className: customClassName,
children,
large = false,
}: SideNavItemProps) => {
const prefix = usePrefix();
const className = cx({
[`${prefix}--side-nav__item`]: true,
[`${prefix}--side-nav__item--large`]: large,
[customClassName]: !!customClassName,
[customClassName as string]: !!customClassName,
});
return <li className={className}>{children}</li>;
}
};

SideNavItem.propTypes = {
/**
Expand Down

0 comments on commit a9d5608

Please sign in to comment.