ksylvest/tights

View on GitHub
src/notification.tsx

Summary

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

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

type Props = {
  color?: Color;
  light?: boolean;
};

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