mirror of
https://github.com/snowball-tools/snowballtools-base.git
synced 2025-09-19 17:44:06 +00:00
* Display commit message in projects and deployments * Handle if current deployment not present * Rename types file --------- Co-authored-by: neeraj <neeraj.rtly@gmail.com>
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import React, { useState } from 'react';
|
|
|
|
import { Button, Typography } from '@material-tailwind/react';
|
|
|
|
import { GitRepositoryDetails } from '../../../../types';
|
|
import ConfirmDialog from '../../../shared/ConfirmDialog';
|
|
|
|
const RepoConnectedSection = ({
|
|
linkedRepo,
|
|
}: {
|
|
linkedRepo: GitRepositoryDetails;
|
|
}) => {
|
|
const [disconnectRepoDialogOpen, setDisconnectRepoDialogOpen] =
|
|
useState(false);
|
|
|
|
return (
|
|
<div className="flex gap-4">
|
|
<div>^</div>
|
|
<div className="grow">
|
|
<Typography variant="small">{linkedRepo.full_name}</Typography>
|
|
<Typography variant="small">Connected just now</Typography>
|
|
</div>
|
|
<div>
|
|
<Button
|
|
onClick={() => setDisconnectRepoDialogOpen(true)}
|
|
variant="outlined"
|
|
size="sm"
|
|
>
|
|
^ Disconnect
|
|
</Button>
|
|
</div>
|
|
<ConfirmDialog
|
|
dialogTitle="Disconnect repository?"
|
|
handleOpen={() => setDisconnectRepoDialogOpen((preVal) => !preVal)}
|
|
open={disconnectRepoDialogOpen}
|
|
confirmButtonTitle="Yes, confirm disconnect"
|
|
handleConfirm={() => {
|
|
setDisconnectRepoDialogOpen((preVal) => !preVal);
|
|
}}
|
|
color="red"
|
|
>
|
|
<Typography variant="small">
|
|
Any data tied to your Git project may become misconfigured. Are you
|
|
sure you want to continue?
|
|
</Typography>
|
|
</ConfirmDialog>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default RepoConnectedSection;
|