Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame
737 Bytes
import React from 'react';
import PropTypes from 'prop-types';
import { firebase } from '../firebase';
export const Checkbox = ({ id, taskDesc }) => {
const archiveTask = () => {
firebase.firestore().collection('tasks').doc(id).update({
archived: true,
});
};
return (
<div
className="checkbox-holder"
data-testid="checkbox-action"
onClick={() => archiveTask()}
onKeyDown={(e) => {
if (e.key === 'Enter') archiveTask();
}}
aria-label={`Mark ${taskDesc} as done?`}
role="button"
tabIndex={0}
>
<span className="checkbox" />
</div>
);
};
Checkbox.propTypes = {
id: PropTypes.string.isRequired,
taskDesc: PropTypes.string.isRequired,
};