@extends('layouts.app')

@section('content')
<div class="container">
    <h2>Add Investment</h2>
    <form action="{{ route('investments.store') }}" method="POST">
        @csrf
        <div class="mb-3">
            <label for="investor_id" class="form-label">Investor</label>
            <select name="investor_id" class="form-control" required>
                <option value="">Select Investor</option>
                @foreach($investors as $investor)
                    <option value="{{ $investor->id }}">{{ $investor->name }}</option>
                @endforeach
            </select>
        </div>

        <div class="mb-3">
            <label for="type" class="form-label">Type</label>
            <input type="text" name="type" class="form-control" required>
        </div>

        <div class="mb-3">
            <label for="amount" class="form-label">Amount</label>
            <input type="number" name="amount" class="form-control" required>
        </div>

        <div class="mb-3">
            <label for="date" class="form-label">Date</label>
            <input type="date" name="date" class="form-control" value="{{ date('Y-m-d') }}" required>
        </div>

        <div class="mb-3">
            <label for="remarks" class="form-label">Remarks</label>
            <textarea name="remarks" class="form-control"></textarea>
        </div>

        <button type="submit" class="btn btn-success">Save</button>
        <a href="{{ route('investments.index') }}" class="btn btn-secondary">Cancel</a>
    </form>
</div>
@endsection
