Is it considered an antipattern to have a container component return different representation elements based on a condition variable passed to it?
For example, I have routes for both the SummaryPageComponent and CustomersPageComponent. The Summary page has a partition that displays a portion of data also seen in greater detail on the Customers page. Creating two separate container components with duplicated data and logic would be redundant. Furthermore, adding this logic to the representation component is not ideal.
My question is, would it be acceptable to create a single container component that returns either
<CustomersSummaryComponent>
or <CustomersDetailsComponent>
depending on a prop like summary=true/false? This approach would allow me to incorporate the Customers domain throughout my application and adjust its presentation as needed. Is this recommended, or would it lead to code maintenance issues?