veza/apps/web/src/components/studio/cloud-settings-view/CloudSettingsViewPreferences.tsx
senke 04656f0c0d refactor: Phase 7 — Clean up legacy components and remove dead tokens
- Bulk replace text-white → text-foreground across 116 component files
  (preserving text-white/ opacity variants)
- Remove hover-glow-cyan, shadow-card-glow-cyan, shadow-button-primary-glow
  classes from all components
- Replace --duration-normal/--duration-immersive/--duration-slow with
  --sumi-duration-normal/--sumi-duration-slow across 130+ files
- Replace --ease-out/--ease-in-out with --sumi-ease-out/--sumi-ease-in-out
- Replace focus:ring-blue-500 → focus:ring-primary (4 files)
- Remove hover:scale-105/110 and hover:-translate-y-1/0.5 transforms
  (SUMI anti-pattern: no scale on hover)
- Clean up stale kodo- references in comments

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 02:09:29 +01:00

80 lines
3 KiB
TypeScript

import { Card } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
import { Clock, MapPin, AlertCircle, Trash2 } from 'lucide-react';
import { RETENTION_OPTIONS, REGION_OPTIONS } from './types';
import type { RetentionValue, RegionValue } from './types';
interface CloudSettingsViewPreferencesProps {
retention: RetentionValue;
onRetentionChange: (value: RetentionValue) => void;
region: RegionValue;
onRegionChange: (value: RegionValue) => void;
onEmptyTrash: () => void;
}
export function CloudSettingsViewPreferences({
retention,
onRetentionChange,
region,
onRegionChange,
onEmptyTrash,
}: CloudSettingsViewPreferencesProps) {
return (
<Card variant="default">
<h3 className="font-bold text-foreground mb-6 tracking-tight">Preferences</h3>
<div className="space-y-6">
<div>
<label className="block text-sm font-bold text-muted-foreground mb-2 flex items-center gap-2">
<Clock className="w-4 h-4" /> Trash Retention Policy
</label>
<select
className="w-full bg-muted border border-border rounded-xl p-4 text-foreground outline-none focus:border-primary transition-colors duration-[var(--sumi-duration-normal)]"
value={retention}
onChange={(e) => onRetentionChange(e.target.value as RetentionValue)}
>
{RETENTION_OPTIONS.map((opt) => (
<option key={opt.value} value={opt.value}>
{opt.label}
</option>
))}
</select>
<p className="text-xs text-muted-foreground mt-1">
Deleted files are permanently removed after this period.
</p>
</div>
<div>
<label className="block text-sm font-bold text-muted-foreground mb-2 flex items-center gap-2">
<MapPin className="w-4 h-4" /> Storage Region
</label>
<select
className="w-full bg-muted border border-border rounded-xl p-4 text-foreground outline-none focus:border-primary transition-colors duration-[var(--sumi-duration-normal)]"
value={region}
onChange={(e) => onRegionChange(e.target.value as RegionValue)}
>
{REGION_OPTIONS.map((opt) => (
<option key={opt.value} value={opt.value}>
{opt.label}
</option>
))}
</select>
<div className="flex items-start gap-2 mt-2 text-xs text-warning bg-warning/10 p-2 rounded-xl">
<AlertCircle className="w-3 h-3 mt-0.5 shrink-0" />
Changing regions requires data migration which may take up to 24 hours.
</div>
</div>
<div className="pt-4 border-t border-border">
<Button
variant="destructive"
className="w-full"
onClick={onEmptyTrash}
>
<Trash2 className="w-4 h-4 mr-2" /> Empty Trash Now
</Button>
</div>
</div>
</Card>
);
}