ksylvest/tights

View on GitHub
src/buttons.tsx

Summary

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

import type { Alignment } from "./types/alignment";

type Props = {
  addons?: boolean;
  alignment?: Alignment;
};

export const Buttons: FC<Omit<ComponentProps<"div">, keyof Props> & Props> = ({
  addons,
  alignment,
  className,
  ...props
}) => (
  <div
    {...props}
    className={clsx(
      "buttons",
      addons && "has-addons",
      alignment && `is-${alignment}`,
      className,
    )}
  />
);