I currently have 2 child components displayed below.
Child component 1:
https://i.sstatic.net/JKzGy.png
Child component 2:
https://i.sstatic.net/u0YpX.png
The styles, positions, and other aspects are identical in both components. However, the content differs - such as images and text. Therefore, I am looking to build a completely component-based Ionic/Angular app. My question is whether I should use 2 separate components or implement the same component with *ngIf and @Input() bindings to dynamically display different text and images based on the parent page?
For example, would it be sufficient to use one component with conditional logic, or is it necessary to create 2 distinct components for these scenarios? It appears that there is a strong link between the components and the parent; therefore, making changes might require extensive modifications due to potential impact on other areas. Am I correct in my assessment?
<ion-grid>
<ion-row>
<ion-col size="12" class="ion-text-center padding-bottom-0">
<h5 class="font-bold margin-top-bottom-5">{{'Client.Parcel-Delivery-Cost' | translate}}</h5>
</ion-col>
<ion-col size="12" class="padding-top-bottom-0 ion-text-center" *ngIf="isPickUp">
<div>{{'Client.Parcel-Picked-Up-From-The-Location-And-Delivered-To-You' | translate}}</div>
</ion-col>
<ion-col size="12" class="padding-top-bottom-0 ion-text-center" *ngIf="!isPickUp">
<div>{{'Client.Parcel-Picked-Up-And-Handed-Over-To-Respective-Courier' | translate}}</div>
</ion-col>
<ion-col size="12" class="padding-top-bottom-0 ion-text-center font-bold">
<h4 class="margin-top-5 font-bold"> {{parcelDeliveryCost}}</h4>
</ion-col>
</ion-row>
</ion-grid>