Spaces:
Sleeping
Sleeping
File size: 695 Bytes
dbcdc7c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import theming from '/src/styles/theming.module.css';
import clsx from 'clsx';
import { useOptions } from '/src/utils/optionsContext';
export const Controls = ({ icon: Icon, fn, size = 18, className, children }) => {
const {
options: { theme },
} = useOptions();
return (
<div
onClick={fn}
className={clsx(
'h-7 flex justify-center items-center rounded-md cursor-pointer hover:opacity-60',
children ? 'px-2 gap-2 min-w-7' : 'w-7',
theming.appItemColor,
theming[`theme-${theme || 'default'}`],
className,
)}
>
<Icon size={size} className="shrink-0" />
{children}
</div>
);
};
export default Controls;
|