MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / LikeButton

Function LikeButton

src/Components/Post/PostContent/PostContent.jsx:191–203  ·  view source on GitHub ↗
({content})

Source from the content-addressed store, hash-verified

189}
190
191function LikeButton({content}) {
192 return (
193 <Form method="post" style={{display: 'inline-flex', alignItems: 'center', gap: '0.25rem'}}>
194 <input type="hidden" name="ContentID" value={content.id}/>
195 <Tooltip title={content.liked ? "取消点赞" : "点赞"} arrow>
196 <IconButton type="submit" name="ActionType" value="ToggleLike" color={content.liked ? "error" : "default"}>
197 {content.liked ? <Favorite/> : <FavoriteBorder/>}
198 </IconButton>
199 </Tooltip>
200 <Typography variant="body2">{content.like_count}</Typography>
201 </Form>
202 );
203}
204
205function CommentForm({parentId, placeholder, onSubmitted}) {
206 const [content, setContent] = useState("");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected