This commit is contained in:
CHIEFSOFT\ameye
2025-09-28 22:42:51 -04:00
parent 4b39b73931
commit 1e28046093
@@ -64,33 +64,39 @@ export default function SubscriptionsCom() {
<div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'> <div className='px-2 py-2 mb-4 flex flex-col sm:flex-row flex-wrap sm:items-center gap-2'>
<Icons name='filter' className='text-3xl'/> <Icons name='filter' className='text-3xl'/>
<div className='w-full sm:max-w-48'> <div className='w-full sm:max-w-48'>
<select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md' onChange={handleFilter}> <select name='type' value={filter?.type} className='h-10 w-full p-2 rounded-md'
onChange={handleFilter}>
<option value=''>All</option> <option value=''>All</option>
<option value='member_id'>Member ID</option> <option value='member_id'>Member ID</option>
<option value='product_id'>Product ID</option> <option value='product_id'>Product ID</option>
</select> </select>
</div> </div>
<div className='w-full sm:max-w-48'> <div className='w-full sm:max-w-48'>
<input name='id' value={filter?.id} disabled={!filter.type} className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`} onChange={handleFilter} /> <input name='id' value={filter?.id} disabled={!filter.type}
className={`h-10 w-full p-2 rounded-md outline-none border border-black-aside ${!filter.type && 'opacity-30'}`}
onChange={handleFilter}/>
</div> </div>
<button onClick={handleFilterByParams} disabled={filter.type && !filter.id} className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit</button> <button onClick={handleFilterByParams} disabled={filter.type && !filter.id}
className={`h-10 bg-primary px-2 py-1 rounded-md text-white font-medium sm:self-end ${(filter.type && !filter.id) && 'opacity-50'}`}>Submit
</button>
</div> </div>
{/* end of filter section */} {/* end of filter section */}
<TablePaginatedWrapper data={subscriptionData} isFetching={isFetching} setPage={setPage} itemsPerPage={pagination?.limit} pagination={pagination}> <TablePaginatedWrapper data={subscriptionData} isFetching={isFetching} setPage={setPage}
itemsPerPage={pagination?.limit} pagination={pagination}>
{({data}) => ( {({data}) => (
<> <>
<table className="py-2 w-full text-sm"> <table className="py-2 w-full text-sm">
<thead className="py-2 text-sm text-slate-500 text-left"> <thead className="py-2 text-sm text-slate-500 text-left">
<tr> <tr>
<th scope="col" className="px-2 py-2"> <th scope="col" className="px-2 py-2">
Added Added/Updated
</th> </th>
<th scope="col" className="px-2"> <th scope="col" className="px-2">
Product Product
</th> </th>
<th scope="col" className="px-2"> <th scope="col" className="px-2">
URL Internal-URL/External-URL/SubscriptionUID
</th> </th>
<th scope="col" className="px-2 text-right"> <th scope="col" className="px-2 text-right">
Status Status
@@ -104,22 +110,30 @@ export default function SubscriptionsCom() {
{(data && data.length > 0) ? data?.map((item, index) => ( {(data && data.length > 0) ? data?.map((item, index) => (
<tr key={index} className="py-2 border-t border-dashed border-slate-300"> <tr key={index} className="py-2 border-t border-dashed border-slate-300">
<td className="px-2 py-2"> <td className="px-2 py-2">
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'> <div
className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
{/* <img className="w-10 h-10 rounded-md" src={localImgLoader(`loan_icons/${item?.type}.png`)} alt="Icon" /> */} {/* <img className="w-10 h-10 rounded-md" src={localImgLoader(`loan_icons/${item?.type}.png`)} alt="Icon" /> */}
<div className="text-left"> <div className="text-left">
<div className="text-base font-semibold">{getDateTimeFromDateString(item?.added)}</div> <div
className="text-base font-semibold">
{getDateTimeFromDateString(item?.added)}<br />
{getDateTimeFromDateString(item?.updated)}<br />
</div>
</div> </div>
</div> </div>
</td> </td>
<td className="px-2"> <td className="px-2">
<div className="text-left"> <div className="text-left">
<div className="text-base font-semibold">{item?.product_id}</div> <div
className="text-base font-semibold">{item?.product_id}</div>
</div> </div>
</td> </td>
<td className="px-2"> <td className="px-2">
<div className="text-left"> <div className="text-left">
<div className="text-base font-semibold">{item?.internal_url}</div> <div className="text-base font-semibold ">
<div className="font-normal text-gray-500">{item?.external_url}</div> <span>Int :</span> {item?.internal_url}<br/>
<span>Ext :</span> {item?.external_url}<br/>
{item?.subscription_uid}</div>
</div> </div>
</td> </td>
<td className="px-2"> <td className="px-2">
@@ -132,7 +146,8 @@ export default function SubscriptionsCom() {
<div <div
className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'> className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Link to={`/subscription-view/${item?.subscription_uid}`} <Link to={`/subscription-view/${item?.subscription_uid}`}
state={{customerID: item?.id, memberUID: item?.member_uid}}> // state={{customerID: item?.id, memberUID: item?.member_uid}}
>
<Icons name='eye'/> <Icons name='eye'/>
</Link> </Link>
</div> </div>