From 23686fa707af9faaea0b2618747c4f9dd1958455 Mon Sep 17 00:00:00 2001 From: Matthew Warman Date: Thu, 11 Jul 2024 10:57:53 -0400 Subject: [PATCH] jsdoc --- src/pages/Users/components/UserDetail/AddressDetail.tsx | 9 ++++++++- src/pages/Users/components/UserDetail/CompanyDetail.tsx | 9 ++++++++- src/pages/Users/components/UserDetail/UserSummary.tsx | 9 ++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/pages/Users/components/UserDetail/AddressDetail.tsx b/src/pages/Users/components/UserDetail/AddressDetail.tsx index 5c9b19f..641fc2c 100644 --- a/src/pages/Users/components/UserDetail/AddressDetail.tsx +++ b/src/pages/Users/components/UserDetail/AddressDetail.tsx @@ -22,7 +22,14 @@ interface AddressDetailProps extends BaseComponentProps { * The `AddressDetail` component renders a block which displays a single * `Address`. * - * If the `address` property is null or undefined, a loading state is rendered. + * If `isLoading` is `true` the loading state is rendered. + * + * If `isLoading` is `false` and the `address` property is provided, the + * address attributes are rendered. + * + * If `isLoading` is `false` and the `address` property is empty, the + * component returns `false` so that the component remains in the React + * hierarchy, but does not render anything. * * @param {AddressDetailProps} props - Component properties. * @returns {JSX.Element | false} Returns JSX when loading or a user is diff --git a/src/pages/Users/components/UserDetail/CompanyDetail.tsx b/src/pages/Users/components/UserDetail/CompanyDetail.tsx index 8286e46..9bbf737 100644 --- a/src/pages/Users/components/UserDetail/CompanyDetail.tsx +++ b/src/pages/Users/components/UserDetail/CompanyDetail.tsx @@ -22,7 +22,14 @@ interface CompanyDetailProps extends BaseComponentProps { * The `CompanyDetail` component renders a block which provides details about * a single `Company`. * - * If the `company` property is null or undefined, a loading state is rendered. + * If `isLoading` is `true` the loading state is rendered. + * + * If `isLoading` is `false` and the `company` property is provided, the + * company attributes are rendered. + * + * If `isLoading` is `false` and the `company` property is empty, the + * component returns `false` so that the component remains in the React + * hierarchy, but does not render anything. * * @param {CompanyDetailProps} props - Component properties. * @returns {JSX.Element | false} Returns JSX when loading or a user is diff --git a/src/pages/Users/components/UserDetail/UserSummary.tsx b/src/pages/Users/components/UserDetail/UserSummary.tsx index 17420bc..4f6b705 100644 --- a/src/pages/Users/components/UserDetail/UserSummary.tsx +++ b/src/pages/Users/components/UserDetail/UserSummary.tsx @@ -23,7 +23,14 @@ interface UserSummaryProps extends BaseComponentProps { * The `UserSummary` component renders a block containing summary information * about a single `User` including their name, email, phone, and website. * - * If the supplied `user` is null or undefined, a loading state is rendered. + * If `isLoading` is `true` the loading state is rendered. + * + * If `isLoading` is `false` and the `user` property is provided, the + * user attributes are rendered. + * + * If `isLoading` is `false` and the `user` property is empty, the + * component returns `false` so that the component remains in the React + * hierarchy, but does not render anything. * * @param {UserSummaryProps} props - Component propertiers. * @returns {JSX.Element | false} Returns JSX when loading or a user is