🐛 fix(GenericNode): add conditional rendering to documentation link to prevent empty href

The documentation link was previously always rendered, even if the href was empty. This caused an issue where the link would be clickable but lead to nowhere. The fix adds a conditional rendering to the link, so it is only rendered if the href is not empty.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-24 16:38:11 -03:00
commit aa4b7bfc32

View file

@ -115,15 +115,17 @@ export default function GenericNode({
</div> </div>
<div className="flex gap-3"> <div className="flex gap-3">
<div className=" px-5 pb-3 mr-5"> <div className=" px-5 pb-3 mr-5">
<Tooltip title={`Open ${data.node.display_name} documentation`}> {data.node.documentation !== "" && (
<a <Tooltip title={`Open ${data.node.display_name} documentation`}>
href={data.node.documentation} <a
target="_blank" href={data.node.documentation}
rel="noopener noreferrer" target="_blank"
> rel="noopener noreferrer"
<Info /> >
</a> <Info />
</Tooltip> </a>
</Tooltip>
)}
</div> </div>
<div> <div>
<Tooltip <Tooltip