import React from "react"; import { Checkbox } from "@/components/ui/checkbox"; import { Label } from "@/components/ui/label"; import { Separator } from "@/components/ui/separator"; import { Badge } from "@/components/ui/badge"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; import { Info, GitBranch, Star, Building2, Lock, Archive, GitPullRequest, Tag, FileText, MessageSquare, Target, BookOpen, GitFork } from "lucide-react"; import type { GitHubConfig, MirrorOptions, AdvancedOptions } from "@/types/config"; import { cn } from "@/lib/utils"; interface GitHubMirrorSettingsProps { githubConfig: GitHubConfig; mirrorOptions: MirrorOptions; advancedOptions: AdvancedOptions; onGitHubConfigChange: (config: GitHubConfig) => void; onMirrorOptionsChange: (options: MirrorOptions) => void; onAdvancedOptionsChange: (options: AdvancedOptions) => void; } export function GitHubMirrorSettings({ githubConfig, mirrorOptions, advancedOptions, onGitHubConfigChange, onMirrorOptionsChange, onAdvancedOptionsChange, }: GitHubMirrorSettingsProps) { const handleGitHubChange = (field: keyof GitHubConfig, value: boolean) => { onGitHubConfigChange({ ...githubConfig, [field]: value }); }; const handleMirrorChange = (field: keyof MirrorOptions, value: boolean) => { onMirrorOptionsChange({ ...mirrorOptions, [field]: value }); }; const handleMetadataComponentChange = (component: keyof MirrorOptions['metadataComponents'], value: boolean) => { onMirrorOptionsChange({ ...mirrorOptions, metadataComponents: { ...mirrorOptions.metadataComponents, [component]: value, }, }); }; const handleAdvancedChange = (field: keyof AdvancedOptions, value: boolean) => { onAdvancedOptionsChange({ ...advancedOptions, [field]: value }); }; // When metadata is disabled, all components should be disabled const isMetadataEnabled = mirrorOptions.mirrorMetadata; return (
Choose which repositories to include in mirroring
Mirror your private repositories (requires appropriate token permissions)
Include repositories you've starred on GitHub
Select what content to mirror from each repository
Source code & branches
Always included
Include GitHub releases, tags, and associated assets
Mirror issues, pull requests, and other repository data
Fine-tune what gets excluded from mirroring
Exclude repositories that are forks of other projects
Only mirror code from starred repos, skip issues and metadata