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
35 lines
672 B
TypeScript
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;
|