interstellar_ai/app/components/settings/DropDownTheme.tsx

41 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-10-07 09:09:15 +02:00
// ThemeDropdown.tsx
import React from 'react';
2024-10-01 12:45:21 +02:00
2024-10-07 09:09:15 +02:00
const ThemeDropdown: React.FC<{
selectedTheme: string;
setSelectedTheme: (theme: string) => void;
}> = ({ selectedTheme, setSelectedTheme }) => {
const themeOptions = [
{ value: 'IOMARKET', label: 'IOMARKET' },
{ value: 'WHITE', label: 'WHITE' },
{ value: 'BLACK', label: 'BLACK' },
{ value: 'BASIC-CUSTOM', label: 'BASIC-CUSTOM' },
{ value: 'CUSTOM', label: 'CUSTOM' },
];
2024-10-01 12:45:21 +02:00
2024-10-07 09:09:15 +02:00
return (
<div className="settings-option">
<p>Select Theme</p>
<select
value={selectedTheme}
onChange={(e) => {
const theme = e.target.value;
2024-10-07 11:16:51 +02:00
if (theme !== 'default' && typeof localStorage !== 'undefined') {
2024-10-07 09:09:15 +02:00
setSelectedTheme(theme);
localStorage.setItem('selectedTheme', theme);
}
}}
>
<option value="default">Select your style...</option>
{themeOptions.map((option) => (
<option key={option.value} value={option.value}>
{option.label}
</option>
))}
</select>
</div>
);
};
2024-10-01 12:45:21 +02:00
2024-10-07 09:09:15 +02:00
export default ThemeDropdown;