ee16977b66
it remains accessible from map (approximate values) and from history tag of given object removal is motivated by desire to avoid misleading "0 people likes this building" - true about database state but not true about world in general exact phrasing is also a bit problematic in general
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import React, { Fragment } from 'react';
|
|
import { NavLink } from 'react-router-dom';
|
|
|
|
import { CopyProps } from '../data-containers/category-view-props';
|
|
import { DataTitleCopyable } from './data-title';
|
|
|
|
|
|
interface UserOpinionEntryProps {
|
|
slug: string;
|
|
title: string;
|
|
mode: 'view' | 'edit' | 'multi-edit';
|
|
userValue: boolean;
|
|
copy: CopyProps;
|
|
onChange: (key: string, value: boolean) => void;
|
|
}
|
|
|
|
const UserOpinionEntry: React.FunctionComponent<UserOpinionEntryProps> = (props) => {
|
|
|
|
return (
|
|
<>
|
|
<DataTitleCopyable
|
|
slug={props.slug}
|
|
title={props.title}
|
|
copy={props.copy}
|
|
/>
|
|
<label className="form-check-label">
|
|
<input className="form-check-input" type="checkbox"
|
|
name={props.slug}
|
|
checked={!!props.userValue}
|
|
disabled={props.mode === 'view'}
|
|
onChange={e => props.onChange(props.slug, e.target.checked)}
|
|
/> Yes
|
|
</label>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default UserOpinionEntry;
|