mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +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