ksylvest/tights

View on GitHub
src/navbar.tsx

Summary

Maintainability
A
3 hrs
Test Coverage
A
100%
import { clsx } from "clsx";
import type { ComponentProps, FC } from "react";

import type { Color } from "./types/color";

type Props = {
  color?: Color;
};

export const Navbar: FC<Omit<ComponentProps<"nav">, keyof Props> & Props> = ({
  color,
  className,
  ...props
}) => (
  <nav
    {...props}
    className={clsx("navbar", color && `is-${color}`, className)}
  />
);