2023-03-30 06:44:33 -07:00
|
|
|
import { SettingsOptions } from '/@/renderer/features/settings/components/settings-option';
|
|
|
|
|
|
|
|
|
|
export type SettingOption = {
|
2023-07-01 19:10:05 -07:00
|
|
|
control: JSX.Element;
|
|
|
|
|
description: string | JSX.Element;
|
|
|
|
|
isHidden?: boolean;
|
|
|
|
|
note?: string;
|
|
|
|
|
title: string;
|
2023-03-30 06:44:33 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
interface SettingsSectionProps {
|
2023-07-01 19:10:05 -07:00
|
|
|
options: SettingOption[];
|
2023-03-30 06:44:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const SettingsSection = ({ options }: SettingsSectionProps) => {
|
2023-07-01 19:10:05 -07:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{options
|
|
|
|
|
.filter((o) => !o.isHidden)
|
|
|
|
|
.map((option) => (
|
|
|
|
|
<SettingsOptions
|
|
|
|
|
key={`general-${option.title}`}
|
|
|
|
|
{...option}
|
|
|
|
|
/>
|
|
|
|
|
))}
|
|
|
|
|
</>
|
|
|
|
|
);
|
2023-03-30 06:44:33 -07:00
|
|
|
};
|