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 { Button } from "@/components/ui/button"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover"; import { Info, GitBranch, Star, Lock, Archive, GitPullRequest, Tag, FileText, MessageSquare, Target, BookOpen, GitFork, ChevronDown, Funnel } 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; // Calculate what content is included for starred repos const starredRepoContent = { code: true, // Always included releases: !advancedOptions.skipStarredIssues && mirrorOptions.mirrorReleases, issues: !advancedOptions.skipStarredIssues && mirrorOptions.mirrorMetadata && mirrorOptions.metadataComponents.issues, pullRequests: !advancedOptions.skipStarredIssues && mirrorOptions.mirrorMetadata && mirrorOptions.metadataComponents.pullRequests, wiki: !advancedOptions.skipStarredIssues && mirrorOptions.mirrorMetadata && mirrorOptions.metadataComponents.wiki, }; const starredContentCount = Object.entries(starredRepoContent).filter(([key, value]) => key !== 'code' && value).length; const totalStarredOptions = 4; // releases, issues, PRs, wiki return (
Choose which repositories to include in mirroring
Mirror your private repositories
Include repositories you've starred on GitHub
Choose what content to mirror from starred repositories. Selecting "Lightweight mode" will only mirror code for better performance.
Content included for starred repos:
To include more content, enable them in the Content & Data section below
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