Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/app/_components/CategorySidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';

import { useState } from 'react';
import { ContextualHelpIcon } from './ContextualHelpIcon';

interface CategorySidebarProps {
categories: string[];
Expand Down Expand Up @@ -201,9 +202,12 @@ export function CategorySidebar({
{/* Header */}
<div className="flex items-center justify-between p-4 border-b border-border">
{!isCollapsed && (
<div>
<h3 className="text-lg font-semibold text-foreground">Categories</h3>
<p className="text-sm text-muted-foreground">{totalScripts} Total scripts</p>
<div className="flex items-center justify-between w-full">
<div>
<h3 className="text-lg font-semibold text-foreground">Categories</h3>
<p className="text-sm text-muted-foreground">{totalScripts} Total scripts</p>
</div>
<ContextualHelpIcon section="available-scripts" tooltip="Help with categories" />
</div>
)}
<button
Expand Down
46 changes: 46 additions & 0 deletions src/app/_components/ContextualHelpIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
'use client';

import { useState } from 'react';
import { HelpModal } from './HelpModal';
import { Button } from './ui/button';
import { HelpCircle } from 'lucide-react';

interface ContextualHelpIconProps {
section: string;
className?: string;
size?: 'sm' | 'default';
tooltip?: string;
}

export function ContextualHelpIcon({
section,
className = '',
size = 'sm',
tooltip = 'Help'
}: ContextualHelpIconProps) {
const [isOpen, setIsOpen] = useState(false);

const sizeClasses = size === 'sm'
? 'h-7 w-7 p-1.5'
: 'h-9 w-9 p-2';

return (
<>
<Button
onClick={() => setIsOpen(true)}
variant="ghost"
size="icon"
className={`${sizeClasses} text-muted-foreground hover:text-foreground hover:bg-muted ${className}`}
title={tooltip}
>
<HelpCircle className="w-4 h-4" />
</Button>

<HelpModal
isOpen={isOpen}
onClose={() => setIsOpen(false)}
initialSection={section}
/>
</>
);
}
9 changes: 9 additions & 0 deletions src/app/_components/FilterBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import React, { useState } from "react";
import { Button } from "./ui/button";
import { ContextualHelpIcon } from "./ContextualHelpIcon";
import { Package, Monitor, Wrench, Server, FileText, Calendar, RefreshCw, Filter } from "lucide-react";

export interface FilterState {
Expand Down Expand Up @@ -104,6 +105,14 @@ export function FilterBar({
</div>
)}

{/* Filter Header */}
{!isLoadingFilters && (
<div className="mb-4 flex items-center justify-between">
<h3 className="text-lg font-medium text-foreground">Filter Scripts</h3>
<ContextualHelpIcon section="available-scripts" tooltip="Help with filtering and searching" />
</div>
)}

{/* Search Bar */}
<div className="mb-4">
<div className="relative max-w-md w-full">
Expand Down
64 changes: 64 additions & 0 deletions src/app/_components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
'use client';

import { api } from '~/trpc/react';
import { Button } from './ui/button';
import { ExternalLink, FileText } from 'lucide-react';

interface FooterProps {
onOpenReleaseNotes: () => void;
}

export function Footer({ onOpenReleaseNotes }: FooterProps) {
const { data: versionData } = api.version.getCurrentVersion.useQuery();

return (
<footer className="sticky bottom-0 mt-auto border-t border-border bg-muted/30 py-6 backdrop-blur-sm">
<div className="container mx-auto px-4">
<div className="flex flex-col sm:flex-row items-center justify-between gap-4 text-sm text-muted-foreground">
<div className="flex items-center gap-4">
<span>© 2024 PVE Scripts Local</span>
{versionData?.success && versionData.version && (
<Button
variant="ghost"
size="sm"
onClick={onOpenReleaseNotes}
className="h-auto p-1 text-xs hover:text-foreground"
>
v{versionData.version}
</Button>
)}
</div>

<div className="flex items-center gap-4">
<Button
variant="ghost"
size="sm"
onClick={onOpenReleaseNotes}
className="h-auto p-2 text-xs hover:text-foreground"
>
<FileText className="h-3 w-3 mr-1" />
Release Notes
</Button>

<Button
variant="ghost"
size="sm"
asChild
className="h-auto p-2 text-xs hover:text-foreground"
>
<a
href="https://github.com/community-scripts/ProxmoxVE-Local"
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-1"
>
<ExternalLink className="h-3 w-3" />
GitHub
</a>
</Button>
</div>
</div>
</div>
</footer>
);
}
6 changes: 5 additions & 1 deletion src/app/_components/GeneralSettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useState, useEffect } from 'react';
import { Button } from './ui/button';
import { Input } from './ui/input';
import { Toggle } from './ui/toggle';
import { ContextualHelpIcon } from './ContextualHelpIcon';

interface GeneralSettingsModalProps {
isOpen: boolean;
Expand Down Expand Up @@ -280,7 +281,10 @@ export function GeneralSettingsModal({ isOpen, onClose }: GeneralSettingsModalPr
<div className="bg-card rounded-lg shadow-xl max-w-4xl w-full max-h-[95vh] sm:max-h-[90vh] overflow-hidden">
{/* Header */}
<div className="flex items-center justify-between p-4 sm:p-6 border-b border-border">
<h2 className="text-xl sm:text-2xl font-bold text-card-foreground">Settings</h2>
<div className="flex items-center gap-2">
<h2 className="text-xl sm:text-2xl font-bold text-card-foreground">Settings</h2>
<ContextualHelpIcon section="general-settings" tooltip="Help with General Settings" />
</div>
<Button
onClick={onClose}
variant="ghost"
Expand Down
40 changes: 40 additions & 0 deletions src/app/_components/HelpButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
'use client';

import { useState } from 'react';
import { HelpModal } from './HelpModal';
import { Button } from './ui/button';
import { HelpCircle } from 'lucide-react';

interface HelpButtonProps {
initialSection?: string;
}

export function HelpButton({ initialSection }: HelpButtonProps) {
const [isOpen, setIsOpen] = useState(false);

return (
<>
<div className="flex flex-col sm:flex-row sm:items-center gap-3">
<div className="text-sm text-muted-foreground font-medium">
Need help?
</div>
<Button
onClick={() => setIsOpen(true)}
variant="outline"
size="default"
className="inline-flex items-center"
title="Open Help"
>
<HelpCircle className="w-5 h-5 mr-2" />
Help
</Button>
</div>

<HelpModal
isOpen={isOpen}
onClose={() => setIsOpen(false)}
initialSection={initialSection}
/>
</>
);
}
Loading