Files
database-petani-mobile/src/components/common/ThemeButton.jsx
T
2026-05-05 17:10:25 +07:00

22 lines
497 B
React

import React from 'react';
import { useTheme } from './ThemeContext';
const ThemeButton = ({ children, onClick }) => {
const { theme } = useTheme();
const buttonStyle = {
backgroundColor: theme === 'light' ? '#fff' : '#333',
color: theme === 'light' ? '#000' : '#fff',
border: '1px solid #ccc',
padding: '10px 20px',
cursor: 'pointer',
};
return (
<button style={buttonStyle} onClick={onClick}>
{children}
</button>
);
};
export default ThemeButton;