<?php
$modal_title = lang('new') . ' ' . lang('attachment');
echo form_open_multipart(base_url('admin/common/save_attachment'), array(
	'id' => 'attachment-form',
	'class' => 'modal-form',
	'data-modal-refresh-page' => '1',
));
?>

<div class="grid gap-4">
	<div class="grid gap-4 md:grid-cols-2">
		<?= form_input_group('title', lang('file_title'), (!empty($add_files_info)) ? $add_files_info->title : '', 'text', true) ?>
		<?= form_textarea_group('description', lang('description'), (!empty($add_files_info)) ? $add_files_info->description : '') ?>
	</div>

	<input type="hidden" name="module" value="<?php echo $module; ?>" class="form-control">
	<input type="hidden" name="module_field_id" value="<?php echo $module_field_id; ?>" class="form-control">

	<?= form_attachment_group('files[]', null, 'dropzone', [
		'dropzone_id' => 'attachements-files-dropzone',
		'list_id' => 'attachements-files-list',
		'comment' => true
	]); ?>
</div>

<div class="mt-6 flex items-center justify-end gap-2">
	<button type="button" class="cancel-upload inline-flex items-center gap-2 rounded-lg border border-slate-200 bg-white px-4 py-2 text-xs font-semibold text-slate-600 hover:bg-slate-50" data-dismiss="modal">
		<i data-lucide="x" class="h-4 w-4"></i>
		<?php echo lang('close'); ?>
	</button>
	<button id="file-save-leads_btn" type="submit"
		class="start-upload inline-flex items-center gap-2 rounded-lg bg-slate-900 px-4 py-2.5 text-xs font-semibold text-white hover:bg-slate-800 dark:bg-slate-700 dark:hover:bg-slate-600">
		<i data-lucide="check-circle" class="h-4 w-4"></i>
		<?php echo lang('save'); ?>
	</button>
</div>
<?php echo form_close(); ?>
