2026-01-07 09:31:02 +00:00
|
|
|
import React, { useState } from 'react';
|
|
|
|
|
import { Card } from '../ui/card';
|
|
|
|
|
import { Button } from '../ui/button';
|
|
|
|
|
import { Input, FileUpload } from '../ui/input';
|
|
|
|
|
import { Save, Camera, FileText } from 'lucide-react';
|
|
|
|
|
import { useToast } from '../../context/ToastContext';
|
|
|
|
|
|
|
|
|
|
export const AddEquipmentView: React.FC = () => {
|
|
|
|
|
const { addToast } = useToast();
|
2026-01-13 18:47:57 +00:00
|
|
|
|
2026-01-07 09:31:02 +00:00
|
|
|
const [formData, setFormData] = useState({
|
2026-01-13 18:47:57 +00:00
|
|
|
category: 'Synth',
|
|
|
|
|
brand: '',
|
|
|
|
|
model: '',
|
|
|
|
|
serial: '',
|
|
|
|
|
purchaseDate: '',
|
|
|
|
|
price: '',
|
|
|
|
|
status: 'Active',
|
|
|
|
|
location: 'Main Studio',
|
|
|
|
|
warrantyEnd: '',
|
|
|
|
|
notes: '',
|
2026-01-07 09:31:02 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const handleChange = (field: string, value: string) => {
|
2026-01-13 18:47:57 +00:00
|
|
|
setFormData((prev) => ({ ...prev, [field]: value }));
|
2026-01-07 09:31:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleSave = () => {
|
2026-01-13 18:47:57 +00:00
|
|
|
if (!formData.brand || !formData.model) {
|
|
|
|
|
addToast('Please fill in basic information', 'error');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
addToast('Equipment added to inventory', 'success');
|
|
|
|
|
// Redirect logic would go here
|
2026-01-07 09:31:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="animate-fadeIn max-w-4xl mx-auto pb-20">
|
2026-01-13 18:47:57 +00:00
|
|
|
<div className="flex justify-between items-center mb-8">
|
2026-01-15 22:54:05 +00:00
|
|
|
<h2 className="text-2xl font-display font-bold text-white">
|
2026-01-13 18:47:57 +00:00
|
|
|
REGISTER EQUIPMENT
|
|
|
|
|
</h2>
|
|
|
|
|
<Button
|
|
|
|
|
variant="primary"
|
|
|
|
|
icon={<Save className="w-4 h-4" />}
|
|
|
|
|
onClick={handleSave}
|
|
|
|
|
>
|
|
|
|
|
Save Item
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
<div className="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
|
|
|
|
{/* Left: Media */}
|
|
|
|
|
<div className="space-y-6">
|
|
|
|
|
<Card variant="default">
|
|
|
|
|
<h3 className="font-bold text-white mb-4 text-sm uppercase tracking-wider flex items-center gap-2">
|
aesthetic-improvements: reduce decorative cyan across multiple component categories (80/20 rule, batch 11)
- Social: FeedView, ConnectionsView, GroupsView, ExploreView, GroupDetailView loading spinners and decorative text, CreatePostModal decorative select text and hashtag links, PostCard decorative tag links and waveform bars and view comments link, CreateGroupModal decorative icon (9 instances)
- Settings: DataExportModal decorative icon, LoginHistory decorative IP text, AppearanceSettingsView decorative icon and selected theme checkmark, BackupsView decorative icon, CloudIntegrationView decorative icon, AccessibilitySettingsView decorative icon, SecuritySettings decorative icon, PasskeyModal decorative icon and loading spinner (8 instances)
- Studio: ProjectsManager loading spinner and progress percentage text, CloudFileBrowser decorative music icons, AIToolsView decorative music icon, ConnectivityView decorative icon, CreateProjectModal decorative icon, CloudSettingsView decorative icon (6 instances)
- Admin: AdminDashboardView loading spinner and decorative chart bars and icon, AdminSettingsView decorative icon, AdminModerationView loading spinner, AdminUsersView loading spinner (5 instances)
- Inventory: InventoryView loading spinner, EquipmentCard decorative price icon, EquipmentDetailView loading spinner and decorative icons and price text, AddEquipmentView decorative icon (5 instances)
- Seller: CreateProductView decorative icon, SellerDashboardView loading spinner and decorative icon and sales text (3 instances)
- Live: LiveStreamDetailView decorative streamer name text (1 instance)
- Developer: DeveloperDashboardView loading spinner, WebhooksView decorative icon (2 instances)
- Upload: BulkUploadModal decorative icon, FilePreviewCard decorative audio file icon, MetadataForm decorative button text, CoverArtUploadModal decorative icon, LyricsEditorModal decorative icon (5 instances)
- Notifications: NotificationItem decorative follow icon and mark as read button, NotificationBell decorative mark all read link (3 instances)
- Total: ~46 files, ~46 instances replaced
- Preserved: Active/selected states (CloudFileBrowser selected files checkmarks, CreatePostModal post type active state, GroupCard/GroupDetailView public/private badges - semantic indicators, DataExportModal checkbox accents - focus/interaction, AppearanceSettingsView selected theme - active state, PasskeyModal checkbox accent - focus/interaction, LyricsEditorModal checkbox accent - focus/interaction, FileUploadZone drag active state - active state, EquipmentDetailView support link - functional link, FlashSaleModal link - functional link, EquipmentDetailView image indicator dots - active state), primary actions, design system variants
- Action 11.3.1.3 in progress (eleventh batch: social, settings, studio, admin, inventory, seller, live, developer, upload, notifications components)
2026-01-16 10:26:33 +00:00
|
|
|
<Camera className="w-4 h-4 text-kodo-steel" /> Photos
|
2026-01-13 18:47:57 +00:00
|
|
|
</h3>
|
aesthetic-improvements: replace secondary cyan hover states with steel (batch 2)
- Card components: CartItem, WishlistView, PostCard, GroupCard, PlaylistsView, UserCard (7 files)
- Settings components: BackupsView, SessionManagement, CloudIntegrationView, OfflineQueueManager (4 files)
- DashboardPage: stat cards and activity items hover states (2 instances)
- FeedView: input and button hover states (2 instances)
- Upload zones: MetadataForm, CreatePlaylistModal, CreateProductView, AddEquipmentView, CreateGroupModal (5 files, 6 instances)
- UserCard: avatar border hover state
- Total: ~18 files, ~20 instances replaced
- Preserved: Focus rings (cyan), active/selected states (cyan)
- Action 11.3.1.2 in progress (second batch complete)
2026-01-16 09:53:34 +00:00
|
|
|
<div className="aspect-square bg-kodo-ink border-2 border-dashed border-kodo-steel rounded-xl flex flex-col items-center justify-center text-kodo-content-dim hover:text-white hover:border-kodo-steel/50 cursor-pointer transition-colors group mb-4">
|
2026-01-13 18:47:57 +00:00
|
|
|
<Camera className="w-8 h-8 mb-2 group-hover:scale-110 transition-transform" />
|
|
|
|
|
<span className="text-xs font-bold uppercase">Upload Photos</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="grid grid-cols-3 gap-2">
|
|
|
|
|
{[1, 2, 3].map((i) => (
|
|
|
|
|
<div
|
|
|
|
|
key={i}
|
|
|
|
|
className="aspect-square bg-kodo-ink rounded border border-kodo-steel/50"
|
|
|
|
|
></div>
|
|
|
|
|
))}
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
2026-01-13 18:47:57 +00:00
|
|
|
</Card>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
<Card variant="default">
|
|
|
|
|
<h3 className="font-bold text-white mb-4 text-sm uppercase tracking-wider flex items-center gap-2">
|
2026-01-16 00:59:31 +00:00
|
|
|
<FileText className="w-4 h-4 text-kodo-content-dim" /> Documents
|
2026-01-13 18:47:57 +00:00
|
|
|
</h3>
|
|
|
|
|
<FileUpload />
|
2026-01-16 00:59:31 +00:00
|
|
|
<p className="text-xs text-kodo-content-dim mt-2 text-center">
|
2026-01-13 18:47:57 +00:00
|
|
|
Receipts, Manuals, Warranty Cards
|
|
|
|
|
</p>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
{/* Right: Form */}
|
|
|
|
|
<div className="lg:col-span-2 space-y-6">
|
|
|
|
|
<Card variant="default">
|
|
|
|
|
<h3 className="font-bold text-white mb-6 border-b border-kodo-steel pb-2">
|
|
|
|
|
Basic Information
|
|
|
|
|
</h3>
|
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
|
|
|
|
|
<div>
|
2026-01-16 00:59:31 +00:00
|
|
|
<label className="block text-sm font-medium text-kodo-content-dim mb-2">
|
2026-01-13 18:47:57 +00:00
|
|
|
Category
|
|
|
|
|
</label>
|
|
|
|
|
<select
|
2026-01-16 10:40:13 +00:00
|
|
|
className="w-full bg-kodo-graphite border border-kodo-steel rounded-lg p-3 text-white focus:border-kodo-steel outline-none"
|
2026-01-13 18:47:57 +00:00
|
|
|
value={formData.category}
|
|
|
|
|
onChange={(e) => handleChange('category', e.target.value)}
|
|
|
|
|
>
|
|
|
|
|
<option>Synth</option>
|
|
|
|
|
<option>Interface</option>
|
|
|
|
|
<option>Microphone</option>
|
|
|
|
|
<option>Computer</option>
|
|
|
|
|
<option>Effect Pedal</option>
|
|
|
|
|
<option>Monitor</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<Input
|
|
|
|
|
label="Status"
|
|
|
|
|
placeholder="Active"
|
|
|
|
|
value={formData.status}
|
|
|
|
|
onChange={(e) => handleChange('status', e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
|
|
|
|
|
<Input
|
|
|
|
|
label="Brand"
|
|
|
|
|
placeholder="e.g. Roland"
|
|
|
|
|
value={formData.brand}
|
|
|
|
|
onChange={(e) => handleChange('brand', e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
<Input
|
|
|
|
|
label="Model"
|
|
|
|
|
placeholder="e.g. TR-8S"
|
|
|
|
|
value={formData.model}
|
|
|
|
|
onChange={(e) => handleChange('model', e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<Input
|
|
|
|
|
label="Serial Number"
|
|
|
|
|
placeholder="S/N..."
|
|
|
|
|
value={formData.serial}
|
|
|
|
|
onChange={(e) => handleChange('serial', e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</Card>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
<Card variant="default">
|
|
|
|
|
<h3 className="font-bold text-white mb-6 border-b border-kodo-steel pb-2">
|
|
|
|
|
Purchase & Warranty
|
|
|
|
|
</h3>
|
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 mb-4">
|
|
|
|
|
<Input
|
|
|
|
|
label="Purchase Date"
|
|
|
|
|
type="date"
|
|
|
|
|
value={formData.purchaseDate}
|
|
|
|
|
onChange={(e) => handleChange('purchaseDate', e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
<Input
|
|
|
|
|
label="Price Paid"
|
|
|
|
|
placeholder="0.00"
|
|
|
|
|
value={formData.price}
|
|
|
|
|
onChange={(e) => handleChange('price', e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
<Input
|
|
|
|
|
label="Warranty Ends"
|
|
|
|
|
type="date"
|
|
|
|
|
value={formData.warrantyEnd}
|
|
|
|
|
onChange={(e) => handleChange('warrantyEnd', e.target.value)}
|
|
|
|
|
/>
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
2026-01-13 18:47:57 +00:00
|
|
|
<div>
|
2026-01-16 00:59:31 +00:00
|
|
|
<label className="block text-sm font-medium text-kodo-content-dim mb-2">
|
2026-01-13 18:47:57 +00:00
|
|
|
Location / Tags
|
|
|
|
|
</label>
|
|
|
|
|
<Input
|
|
|
|
|
placeholder="Main Studio, Rack A..."
|
|
|
|
|
value={formData.location}
|
|
|
|
|
onChange={(e) => handleChange('location', e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
<Card variant="default">
|
|
|
|
|
<h3 className="font-bold text-white mb-4 border-b border-kodo-steel pb-2">
|
|
|
|
|
Notes
|
|
|
|
|
</h3>
|
|
|
|
|
<textarea
|
2026-01-16 10:40:13 +00:00
|
|
|
className="w-full bg-kodo-graphite border border-kodo-steel rounded-lg p-3 text-white focus:border-kodo-steel outline-none min-h-[100px]"
|
2026-01-13 18:47:57 +00:00
|
|
|
placeholder="Condition notes, modifications, etc..."
|
|
|
|
|
value={formData.notes}
|
|
|
|
|
onChange={(e) => handleChange('notes', e.target.value)}
|
|
|
|
|
/>
|
|
|
|
|
</Card>
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
2026-01-13 18:47:57 +00:00
|
|
|
</div>
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|