mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
- Removed Telegram setup instructions from settings page. - Enhanced video and version comment APIs to include tag information. - Added new CommentTag model in Prisma schema for managing tags. - Created API routes for managing tags (GET, POST, PATCH, DELETE). - Updated WatchPage to support tag selection and display. - Introduced keyboard shortcuts modal for improved user experience. - Added tag selection dropdown in comment input area.
93 lines
2.7 KiB
TypeScript
93 lines
2.7 KiB
TypeScript
'use client';
|
|
|
|
import {
|
|
Dialog,
|
|
DialogContent,
|
|
DialogHeader,
|
|
DialogTitle,
|
|
} from '@/components/ui/dialog';
|
|
|
|
interface ShortcutItem {
|
|
keys: string[];
|
|
description: string;
|
|
}
|
|
|
|
interface ShortcutGroup {
|
|
title: string;
|
|
shortcuts: ShortcutItem[];
|
|
}
|
|
|
|
const shortcutGroups: ShortcutGroup[] = [
|
|
{
|
|
title: 'Playback',
|
|
shortcuts: [
|
|
{ keys: ['Space', 'K'], description: 'Play / Pause' },
|
|
{ keys: ['M'], description: 'Mute / Unmute' },
|
|
],
|
|
},
|
|
{
|
|
title: 'Seeking',
|
|
shortcuts: [
|
|
{ keys: ['←'], description: 'Seek back 5s' },
|
|
{ keys: ['→'], description: 'Seek forward 5s' },
|
|
{ keys: ['J'], description: 'Seek back 10s' },
|
|
{ keys: ['L'], description: 'Seek forward 10s' },
|
|
],
|
|
},
|
|
{
|
|
title: 'Speed',
|
|
shortcuts: [
|
|
{ keys: ['↑'], description: 'Increase speed' },
|
|
{ keys: ['↓'], description: 'Decrease speed' },
|
|
{ keys: ['⇧', '>'], description: 'Increase speed' },
|
|
{ keys: ['⇧', '<'], description: 'Decrease speed' },
|
|
],
|
|
},
|
|
];
|
|
|
|
interface KeyboardShortcutsModalProps {
|
|
open: boolean;
|
|
onOpenChange: (open: boolean) => void;
|
|
}
|
|
|
|
export function KeyboardShortcutsModal({ open, onOpenChange }: KeyboardShortcutsModalProps) {
|
|
return (
|
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
<DialogContent className="sm:max-w-md">
|
|
<DialogHeader>
|
|
<DialogTitle className="text-base">Keyboard Shortcuts</DialogTitle>
|
|
</DialogHeader>
|
|
<div className="space-y-5 mt-1">
|
|
{shortcutGroups.map((group) => (
|
|
<div key={group.title}>
|
|
<h4 className="text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2.5">
|
|
{group.title}
|
|
</h4>
|
|
<div className="space-y-1.5">
|
|
{group.shortcuts.map((shortcut, i) => (
|
|
<div
|
|
key={i}
|
|
className="flex items-center justify-between py-1.5 px-2 rounded-md hover:bg-muted/50 transition-colors"
|
|
>
|
|
<span className="text-sm">{shortcut.description}</span>
|
|
<div className="flex items-center gap-1">
|
|
{shortcut.keys.map((key, j) => (
|
|
<kbd
|
|
key={j}
|
|
className="inline-flex h-6 min-w-6 items-center justify-center rounded border border-border bg-muted px-1.5 font-mono text-xs text-muted-foreground"
|
|
>
|
|
{key}
|
|
</kbd>
|
|
))}
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</DialogContent>
|
|
</Dialog>
|
|
);
|
|
}
|