mirror of
https://github.com/Infisical/infisical.git
synced 2025-04-14 17:22:51 +00:00
misc: added loading state
This commit is contained in:
@ -9,7 +9,7 @@ type Props = {
|
||||
};
|
||||
|
||||
export const CamundaDestinationSyncCol = ({ secretSync }: Props) => {
|
||||
const { data: clusters } = useCamundaConnectionListClusters(secretSync.connectionId);
|
||||
const { data: clusters, isPending } = useCamundaConnectionListClusters(secretSync.connectionId);
|
||||
|
||||
const { primaryText, secondaryText } = getSecretSyncDestinationColValues({
|
||||
...secretSync,
|
||||
@ -21,5 +21,9 @@ export const CamundaDestinationSyncCol = ({ secretSync }: Props) => {
|
||||
}
|
||||
});
|
||||
|
||||
if (isPending) {
|
||||
return <SecretSyncTableCell primaryText="Loading cluster info..." secondaryText="Cluster" />;
|
||||
}
|
||||
|
||||
return <SecretSyncTableCell primaryText={primaryText} secondaryText={secondaryText} />;
|
||||
};
|
||||
|
@ -7,11 +7,15 @@ type Props = {
|
||||
};
|
||||
|
||||
export const CamundaSyncDestinationSection = ({ secretSync }: Props) => {
|
||||
const { data: clusters } = useCamundaConnectionListClusters(secretSync.connectionId);
|
||||
const { data: clusters, isPending } = useCamundaConnectionListClusters(secretSync.connectionId);
|
||||
const {
|
||||
destinationConfig: { clusterUUID }
|
||||
} = secretSync;
|
||||
|
||||
if (isPending) {
|
||||
return <GenericFieldLabel label="Cluster">Loading...</GenericFieldLabel>;
|
||||
}
|
||||
|
||||
const clusterName = clusters?.find((cluster) => cluster.uuid === clusterUUID)?.name;
|
||||
return <GenericFieldLabel label="Cluster">{clusterName ?? clusterUUID}</GenericFieldLabel>;
|
||||
};
|
||||
|
Reference in New Issue
Block a user