<form action="{{$action_url}}" method="post" enctype="multipart/form-data">
    <div>
        @php
            isset($source->url) ? $url = $source->url : $url = '';
        @endphp
        <label>URL</label><br />
        <input type="text" name="url" value="{{$url}}" />
        <br />
        @php
            isset($source->type) ? $type = $source->type : $type = '';
        @endphp
        <label>Type</label><br />
        <select name="type">
            @if($type == 'mastodon')
                <option value="mastodon" selected>Mastodon</option>
                <option value="gotosocial">GoToSocial</option>
            @else
                <option value="mastodon">Mastodon</option>
                <option value="gotosocial" selected>GoToSocial</option>
            @endif
        </select>
        <br />
        @php
            isset($source->format) ? $format = $source->format : $format = '';
        @endphp
        <label>Format</label><br />
        <select name="format">
            @if($format == 'json')
                <option value="json" selected>JSON</option>
                <option value="csv">CSV</option>
            @else
                <option value="json">JSON</option>
                <option value="csv" selected>CSV</option>
            @endif
        </select>
        <br />

        @php
            isset($source->active) ? $status = $source->active : $status = false;
        @endphp
        <label>Active?</label><br />
        <select name="status">
            @if($status)
                <option value="true" selected>Active</option>
                <option value="false">Not Active</option>
            @else
                <option value="true">Active</option>
                <option value="false" selected>Not Active</option>
            @endif
        </select>
        <br />
        @php
            isset($source->token) ? $token = $source->token : $token = '';
        @endphp
        <label>Access Token (enter 'none' to clear)</label><br />
        <input type="text" name="token" value="{{$token}}" />
        <br />

    </div>
    @csrf
    @php
        isset($source->id) ? $id = $source->id : $id = 0;
    @endphp
    <input type="hidden" name="id" value="{{$id}}" />
    <input type="submit" value="Edit Source" name="submit_button">
</form>