Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d5d0672cc | |||
| 09def50875 |
@@ -4,7 +4,7 @@ import linkedInLogo from "../../../assets/images/Linkedin.png";
|
|||||||
import appleLogo from "../../../assets/images/apple-black.svg";
|
import appleLogo from "../../../assets/images/apple-black.svg";
|
||||||
import facebookLogo from "../../../assets/images/facebook.svg";
|
import facebookLogo from "../../../assets/images/facebook.svg";
|
||||||
import googleLogo from "../../../assets/images/google-logo.svg";
|
import googleLogo from "../../../assets/images/google-logo.svg";
|
||||||
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
|
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text_new.png";
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import InputCom from "../../Helpers/Inputs/InputCom";
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
import AuthLayout from "../AuthLayout2";
|
import AuthLayout from "../AuthLayout2";
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ export default function AttachFile({data='', showOnData=false}) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!showOnData ?
|
{!showOnData ?
|
||||||
<div className='w-full h-full flex flex-col justify-center items-center rounded-md'>
|
<div className='w-full h-full flex flex-col justify-center items-center'>
|
||||||
<div className='w-full flex flex-col items-start gap-1 overflow-hidden'>
|
<div className='w-full flex flex-col items-start gap-1 overflow-hidden'>
|
||||||
<div className='w-full flex justify-between items-center gap-1'>
|
<div className='w-full flex justify-between items-center gap-1'>
|
||||||
<div className='job-label job-label-flex'>
|
<div className='job-label job-label-flex'>
|
||||||
@@ -84,37 +84,39 @@ export default function AttachFile({data='', showOnData=false}) {
|
|||||||
<span className={`text-[10px] ${requestStatus.status ? 'text-emerald-600' : 'text-red-500'}`}>{requestStatus.message}</span>
|
<span className={`text-[10px] ${requestStatus.status ? 'text-emerald-600' : 'text-red-500'}`}>{requestStatus.message}</span>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<label htmlFor='file' className={`cursor-pointer text-[12px] py-1 px-2 rounded-full border ${ requestStatus.loading && 'pointer-events-none'}`}>+ Add</label>
|
<label htmlFor='file' className={`dark:text-white cursor-pointer text-[12px] py-1 px-2 rounded-full border ${ requestStatus.loading && 'pointer-events-none'}`}>+ Add</label>
|
||||||
</div>
|
</div>
|
||||||
<div className='text-[12px] w-full px-2 py-1 h-20 overflow-y-auto flex flex-col gap-1 border'>
|
<div className='w-full p-2 rounded-2xl bg-slate-100'>
|
||||||
{uploadedList.loading ?
|
<div className='text-[12px] w-full h-20 overflow-y-auto flex flex-col gap-1'>
|
||||||
<div className='w-full h-full justify-center items-center'>
|
{uploadedList.loading ?
|
||||||
<LoadingSpinner size='6' height='h-full' />
|
<div className='w-full h-full justify-center items-center'>
|
||||||
|
<LoadingSpinner size='6' height='h-full' />
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
Object.keys(uploadedList.data).length > 0 ?
|
||||||
|
uploadedList.data.result_list.length > 0 ?
|
||||||
|
uploadedList.data.result_list.map((item, index) => {
|
||||||
|
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
||||||
|
return(
|
||||||
|
<div key={item.file_uid} className='text-sm my-1 flex justify-start gap-2'>
|
||||||
|
<span>{index + 1}:</span>
|
||||||
|
<a
|
||||||
|
target='_blank'
|
||||||
|
alt='download-link'
|
||||||
|
className=''
|
||||||
|
href={`${uploadedList?.data?.session_image_server}/${localStorage.getItem("session_token")}/jobfile/${item.file_uid}`}
|
||||||
|
>
|
||||||
|
{(item.originalname).toString().length > 30 ? (item.originalname).toString().slice(0, 26) + '..._.' + fileNameExt : (item.originalname).toString()}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
:
|
||||||
|
<p className='text-sm'>No Uploaded files yet</p>
|
||||||
|
:
|
||||||
|
<></>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
:
|
|
||||||
Object.keys(uploadedList.data).length > 0 ?
|
|
||||||
uploadedList.data.result_list.length > 0 ?
|
|
||||||
uploadedList.data.result_list.map((item, index) => {
|
|
||||||
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
|
||||||
return(
|
|
||||||
<div key={item.file_uid} className='my-1 flex justify-start gap-2'>
|
|
||||||
<span>{index + 1}:</span>
|
|
||||||
<a
|
|
||||||
target='_blank'
|
|
||||||
alt='download-link'
|
|
||||||
className=''
|
|
||||||
href={`${uploadedList?.data?.session_image_server}/${localStorage.getItem("session_token")}/jobfile/${item.file_uid}`}
|
|
||||||
>
|
|
||||||
{(item.originalname).toString().length > 30 ? (item.originalname).toString().slice(0, 26) + '..._.' + fileNameExt : (item.originalname).toString()}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
})
|
|
||||||
:
|
|
||||||
<p className='text-sm'>No Uploaded files yet</p>
|
|
||||||
:
|
|
||||||
<></>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
@@ -126,31 +128,33 @@ export default function AttachFile({data='', showOnData=false}) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
:showOnData && uploadedList?.data?.result_list?.length > 0 ?
|
:showOnData && uploadedList?.data?.result_list?.length > 0 ?
|
||||||
<div className='w-full h-full flex flex-col justify-center items-center rounded-md'>
|
<div className='w-full h-full flex flex-col justify-center items-center'>
|
||||||
<div className='w-full flex flex-col items-start gap-1 overflow-hidden'>
|
<div className='w-full flex flex-col items-start gap-1 overflow-hidden'>
|
||||||
<div className='w-full flex justify-between items-center gap-1'>
|
<div className='w-full flex justify-between items-center gap-1'>
|
||||||
<div className='job-label job-label-flex'>
|
<div className='job-label job-label-flex'>
|
||||||
Files
|
Files
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='text-[12px] w-full px-2 py-1 h-20 overflow-y-auto flex flex-col gap-1 border'>
|
<div className='w-full p-2 rounded-2xl bg-slate-100'>
|
||||||
{uploadedList.data.result_list.map((item, index) => {
|
<div className='text-[12px] w-full p-2 h-20 overflow-y-auto flex flex-col gap-1'>
|
||||||
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
{uploadedList.data.result_list.map((item, index) => {
|
||||||
return(
|
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
||||||
<div key={item.file_uid} className='flex justify-start gap-2'>
|
return(
|
||||||
<span>{index + 1}:</span>
|
<div key={item.file_uid} className='flex justify-start gap-2'>
|
||||||
<a
|
<span>{index + 1}:</span>
|
||||||
target='_blank'
|
<a
|
||||||
alt='download-link'
|
target='_blank'
|
||||||
className=''
|
alt='download-link'
|
||||||
href={`${uploadedList?.data?.session_image_server}/${localStorage.getItem("session_token")}/jobfile/${item.file_uid}`}
|
className=''
|
||||||
>
|
href={`${uploadedList?.data?.session_image_server}/${localStorage.getItem("session_token")}/jobfile/${item.file_uid}`}
|
||||||
{(item.originalname).toString().length > 30 ? (item.originalname).toString().slice(0, 26) + '..._.' + fileNameExt : (item.originalname).toString()}
|
>
|
||||||
</a>
|
{(item.originalname).toString().length > 30 ? (item.originalname).toString().slice(0, 26) + '..._.' + fileNameExt : (item.originalname).toString()}
|
||||||
</div>
|
</a>
|
||||||
)
|
</div>
|
||||||
})
|
)
|
||||||
}
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
|
|||||||
Reference in New Issue
Block a user