update button download temlate csv on add notification

This commit is contained in:
rajaoktf
2025-10-14 13:33:49 +07:00
parent 593ac48a32
commit a0e00e429f
2 changed files with 25 additions and 8 deletions

View File

@ -0,0 +1,4 @@
MSISDN
67073111111
67073222222
67073333333
1 MSISDN
2 67073111111
3 67073222222
4 67073333333

View File

@ -469,14 +469,27 @@ const AddDialog = () => {
<label className="form-label flex items-center gap-1 max-w-56"> <label className="form-label flex items-center gap-1 max-w-56">
Upload MSISDN CSV Upload MSISDN CSV
</label> </label>
<div className="flex-1 flex flex-col gap-2"> <div className="flex flex-col gap-2 flex-1">
<Input {/* Baris upload + button */}
ref={fileInputRef} <div className="flex items-center gap-3">
type="file" <Input
accept=".csv" ref={fileInputRef}
onChange={handleFileUpload} type="file"
className="input col-span-6" accept=".csv"
/> onChange={handleFileUpload}
className="input flex-1"
/>
<a
href="/media/file-templates/template_notification.csv"
download
className="px-3 py-2 rounded-md bg-blue-600 text-white text-sm font-medium hover:bg-blue-700"
>
Download Template CSV
</a>
</div>
{/* Info file yang sudah diupload */}
{uploadedFileName && formField.customer_phone.length > 0 && ( {uploadedFileName && formField.customer_phone.length > 0 && (
<div className="flex items-center gap-2 text-sm text-green-600 bg-green-50 px-3 py-2 rounded-md"> <div className="flex items-center gap-2 text-sm text-green-600 bg-green-50 px-3 py-2 rounded-md">
<Check className="w-4 h-4" /> <Check className="w-4 h-4" />