mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-06 07:53:54 +00:00
139b667e20
* refactor: folder structure * style: modal wrapper * feat: add nordic translations
30 lines
821 B
TypeScript
30 lines
821 B
TypeScript
import { PropsWithChildren } from 'react';
|
|
import { FormControl } from '@chakra-ui/react';
|
|
|
|
import style from './settings-modal/SettingsModal.module.scss';
|
|
|
|
interface ModalSplitInputProps {
|
|
field: string;
|
|
title: string;
|
|
description: string;
|
|
error?: string;
|
|
}
|
|
|
|
export default function ModalSplitInput(props: PropsWithChildren<ModalSplitInputProps>) {
|
|
const { field, title, description, error, children } = props;
|
|
|
|
return (
|
|
<FormControl isInvalid={!!error} className={style.splitSection}>
|
|
<label htmlFor={field}>
|
|
<span className={style.sectionTitle}>{title}</span>
|
|
{error ? (
|
|
<span className={style.error}>{error}</span>
|
|
) : (
|
|
<span className={style.sectionSubtitle}>{description}</span>
|
|
)}
|
|
</label>
|
|
{children}
|
|
</FormControl>
|
|
);
|
|
}
|