mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
refactor(frontend): simplify JSX conditional rendering
JSX conditional rendering can be simplified to use the logical AND operator (&&) [1] instead of ternary operator (? :) if we want to render something only when the conditon is true, and nothing otherwise. [1]: https://react.dev/learn/conditional-rendering#logical-and-operator- Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -92,7 +92,7 @@ export default function ConversationTile({
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
{conversationId === conversation.id ? (
|
||||
{conversationId === conversation.id && (
|
||||
<div className="flex">
|
||||
<img
|
||||
src={isEdit ? CheckMark : Edit}
|
||||
@@ -122,7 +122,7 @@ export default function ConversationTile({
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user