({
api,
channel,
isUserAuthenticated,
}: {
api: ApiClient;
channel: SerializedChannel | null;
isUserAuthenticated: boolean;
})
| 262 | } |
| 263 | |
| 264 | function ShowIntegrationDetail({ |
| 265 | api, |
| 266 | channel, |
| 267 | isUserAuthenticated, |
| 268 | }: { |
| 269 | api: ApiClient; |
| 270 | channel: SerializedChannel | null; |
| 271 | isUserAuthenticated: boolean; |
| 272 | }) { |
| 273 | const [value, setValue] = useState<{ data: any; type: string }>(); |
| 274 | |
| 275 | useEffect(() => { |
| 276 | isUserAuthenticated && |
| 277 | channel && |
| 278 | channel.id && |
| 279 | api |
| 280 | .getChannelIntegrations({ |
| 281 | channelId: channel.id, |
| 282 | accountId: channel.accountId!, |
| 283 | }) |
| 284 | .then(setValue) |
| 285 | .catch((e) => { |
| 286 | console.error(e); |
| 287 | }); |
| 288 | }, [isUserAuthenticated, channel]); |
| 289 | |
| 290 | return ( |
| 291 | <> |
| 292 | {value && ( |
| 293 | <span |
| 294 | className={ |
| 295 | styles['text-xs-text-gray-400-flex-gap-1-pl-4-pr-1-items-center'] |
| 296 | } |
| 297 | > |
| 298 | {value.type === 'GITHUB' && ( |
| 299 | <> |
| 300 | <FiGithub /> {value.data?.owner}/{value.data?.repo} |
| 301 | </> |
| 302 | )} |
| 303 | {value.type === 'EMAIL' && ( |
| 304 | <> |
| 305 | <FiMail /> {value.data?.email} |
| 306 | </> |
| 307 | )} |
| 308 | {value.type === 'LINEAR' && ( |
| 309 | <> |
| 310 | <CgLinear /> {showLinearDetail(value)} |
| 311 | </> |
| 312 | )} |
| 313 | </span> |
| 314 | )} |
| 315 | </> |
| 316 | ); |
| 317 | } |
| 318 | |
| 319 | export default { |
| 320 | IntegrationsModal, |
nothing calls this directly
no test coverage detected