For the code shown, yes. Because the code shown has no sensitive information. What you're doing in the code shown is presenting two different interfaces based on whether the user is authenticated.
The real question you need to ask yourself is what information is sent to the client for an unauthenticated user. Do these components contain sensitive information? If so, conditionally hising/showing them makes no difference. The information has already been sent to the client, so the client has it.
Changing the UI based on authentication is fine to do client-side. But showing/hiding sensitive information should always be server-side, since determining that client-side would involve sending that information to the client before making that determination. (And would involve making that determination on the client, which is inherently insecure.)
As long as the actual sensitive information requires providing authentication/authorization to the server to get that data in response, all you're doing in the client-side code is presenting a user experience. Even if a user were to modify that, they wouldn't be able to get any sensitive information without interacting with the server.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…