feishin/src/renderer/features/settings/components/settings-section.tsx

30 lines
741 B
TypeScript
Raw Normal View History

2023-09-15 20:42:38 -07:00
import { ReactNode } from 'react';
2023-03-30 06:44:33 -07:00
import { SettingsOptions } from '/@/renderer/features/settings/components/settings-option';
export type SettingOption = {
2023-09-15 20:42:38 -07:00
control: ReactNode;
description: string | ReactNode;
2023-07-01 19:10:05 -07:00
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
};