@@ -10,19 +10,27 @@ import { FormButtons } from "../primitives/FormButtons";
1010import { Input } from "../primitives/Input" ;
1111import { InputGroup } from "../primitives/InputGroup" ;
1212import { Paragraph } from "../primitives/Paragraph" ;
13+ import { CheckboxWithLabel } from "../primitives/Checkbox" ;
1314import { Spinner } from "../primitives/Spinner" ;
1415
1516type ModalProps = {
1617 id : string ;
1718 title : string ;
19+ hasVercelIntegration : boolean ;
20+ isDevelopment : boolean ;
1821} ;
1922
2023type ModalContentProps = ModalProps & {
2124 randomWord : string ;
2225 closeModal : ( ) => void ;
2326} ;
2427
25- export function RegenerateApiKeyModal ( { id, title } : ModalProps ) {
28+ export function RegenerateApiKeyModal ( {
29+ id,
30+ title,
31+ hasVercelIntegration,
32+ isDevelopment,
33+ } : ModalProps ) {
2634 const randomWord = generateTwoRandomWords ( ) ;
2735 const [ open , setOpen ] = useState ( false ) ;
2836 return (
@@ -37,6 +45,8 @@ export function RegenerateApiKeyModal({ id, title }: ModalProps) {
3745 < RegenerateApiKeyModalContent
3846 id = { id }
3947 title = { title }
48+ hasVercelIntegration = { hasVercelIntegration }
49+ isDevelopment = { isDevelopment }
4050 randomWord = { randomWord }
4151 closeModal = { ( ) => setOpen ( false ) }
4252 />
@@ -45,7 +55,14 @@ export function RegenerateApiKeyModal({ id, title }: ModalProps) {
4555 ) ;
4656}
4757
48- const RegenerateApiKeyModalContent = ( { id, randomWord, title, closeModal } : ModalContentProps ) => {
58+ const RegenerateApiKeyModalContent = ( {
59+ id,
60+ randomWord,
61+ title,
62+ hasVercelIntegration,
63+ isDevelopment,
64+ closeModal,
65+ } : ModalContentProps ) => {
4966 const [ confirmationText , setConfirmationText ] = useState ( "" ) ;
5067 const fetcher = useFetcher ( ) ;
5168 const isSubmitting = fetcher . state === "submitting" ;
@@ -83,6 +100,15 @@ const RegenerateApiKeyModalContent = ({ id, randomWord, title, closeModal }: Mod
83100 onChange = { ( e ) => setConfirmationText ( e . target . value ) }
84101 />
85102 </ InputGroup >
103+ { hasVercelIntegration && ! isDevelopment && (
104+ < CheckboxWithLabel
105+ name = "syncToVercel"
106+ variant = "simple/small"
107+ label = "Also update TRIGGER_SECRET_KEY in Vercel"
108+ defaultChecked = { true }
109+ value = "on"
110+ />
111+ ) }
86112 < FormButtons
87113 confirmButton = {
88114 < Button
0 commit comments