* feat(frontend): convert to ts * refactor(frontend): axios-override - simplify shouldMock type * fix: refine stage labels * refactor(frontend): refine `useUserId` signature * fix(frontend): descriptionLines and langsCount can be undefined * refactor(frontend): refine casting on redirectCode * refactor(frontend): refine stageIndex title and types * refactor(frontend): apply pr review comments changes * refactor(frontend): group properties using reference groups * refactor(frontend): remove outdated comment * fix(frontend): mock-http - simplify code
36 lines
692 B
TypeScript
36 lines
692 B
TypeScript
import { Section } from "./Section";
|
|
import { Checkbox } from "../Generic/Checkbox";
|
|
import type { JSX } from "react";
|
|
|
|
interface CheckboxSectionProps {
|
|
title: string;
|
|
question: string;
|
|
checked: boolean;
|
|
|
|
text?: string;
|
|
disabled?: boolean;
|
|
|
|
onCheckedChange: (check: boolean) => void;
|
|
}
|
|
|
|
export function CheckboxSection({
|
|
title,
|
|
text,
|
|
question,
|
|
checked,
|
|
onCheckedChange,
|
|
disabled = false,
|
|
}: CheckboxSectionProps): JSX.Element {
|
|
return (
|
|
<Section title={title}>
|
|
{text && <p>{text}</p>}
|
|
<Checkbox
|
|
question={question}
|
|
checked={checked}
|
|
onCheckedChange={onCheckedChange}
|
|
disabled={disabled}
|
|
/>
|
|
</Section>
|
|
);
|
|
}
|