anyone-oslo/pages

View on GitHub
app/javascript/components/PageForm/TabPanel.tsx

Summary

Maintainability
A
0 mins
Test Coverage
type Props = {
  active: boolean;
};

export default function TabPanel(props: React.PropsWithChildren<Props>) {
  const { active, children } = props;

  const classNames = ["content-tab"];
  if (!active) {
    classNames.push("hidden");
  }

  return (
    <div className={classNames.join(" ")} role="tabpanel">
      {children}
    </div>
  );
}