Files
outline/app/scenes/Settings/components/NotificationListItem.tsx
Tom Moor 15b1069bcc chore: Move to Typescript (#2783)
This PR moves the entire project to Typescript. Due to the ~1000 ignores this will lead to a messy codebase for a while, but the churn is worth it – all of those ignore comments are places that were never type-safe previously.

closes #1282
2021-11-29 06:40:55 -08:00

35 lines
672 B
TypeScript

import * as React from "react";
import NotificationSetting from "~/models/NotificationSetting";
import Checkbox from "~/components/Checkbox";
type Props = {
setting?: NotificationSetting;
title: string;
event: string;
description: string;
disabled: boolean;
onChange: (ev: React.SyntheticEvent) => void | Promise<void>;
};
const NotificationListItem = ({
setting,
title,
event,
onChange,
disabled,
description,
}: Props) => {
return (
<Checkbox
label={title}
name={event}
checked={!!setting}
onChange={onChange}
note={description}
disabled={disabled}
/>
);
};
export default NotificationListItem;