addons/isl/src/__mocks__/%40primer/react.tsxblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318export const Box = (p: React.PropsWithChildren<{as?: 'tr' | 'td'; onClick?: () => unknown}>) => {
b69ab319 if (p.as === 'tr') {
b69ab3110 return <tr onClick={p.onClick}>{p.children}</tr>;
b69ab3111 } else if (p.as === 'td') {
b69ab3112 return <td onClick={p.onClick}>{p.children}</td>;
b69ab3113 }
b69ab3114 return <div onClick={p.onClick}>{p.children}</div>;
b69ab3115};
b69ab3116export const Text = (p: React.PropsWithChildren) => <div>{p.children}</div>;
b69ab3117export const BaseStyles = (p: React.PropsWithChildren) => <div>{p.children}</div>;
b69ab3118export const ThemeProvider = (p: React.PropsWithChildren) => <div>{p.children}</div>;
b69ab3119export const IconButton = ({icon: _, ...p}: React.PropsWithChildren & {icon?: unknown}) => (
b69ab3120 <button {...p} />
b69ab3121);
b69ab3122export const Tooltip = (p: React.PropsWithChildren) => <div {...p} />;
b69ab3123export const Spinner = () => <div />;
b69ab3124
b69ab3125export function useTheme() {
b69ab3126 return {};
b69ab3127}