UI alignment at view Jobs.

This commit is contained in:
Kartik Sharma 2025-11-17 11:29:44 +05:30
parent 8761c128e6
commit 12184091cd

View File

@ -22,7 +22,7 @@ const JobComments = ({ data }) => {
formState: { errors }, formState: { errors },
} = useAppForm({ } = useAppForm({
resolver: zodResolver(JobCommentSchema), resolver: zodResolver(JobCommentSchema),
defaultValues:{ comment: "", attachments: [] } defaultValues: { comment: "", attachments: [] }
}); });
const { const {
@ -119,38 +119,49 @@ const JobComments = ({ data }) => {
</div> </div>
</div> </div>
<div className="d-flex justify-content-end gap-3 align-items-center text-end mt-3"> <div className="d-flex flex-column flex-md-row justify-content-between align-items-start">
<div {/* LEFT SIDE → Uploaded Files */}
onClick={() => document.getElementById("attachments").click()} <div className="flex-grow-1 ms-10 mt-2">
className="cursor-pointer" {files?.length > 0 && (
> <Filelist files={files} removeFile={removeFile} />
<input )}
type="file" </div>
accept=".pdf,.jpg,.jpeg,.png"
id="attachments" {/* RIGHT SIDE → Add Attachment + Submit */}
multiple <div className="d-flex gap-3 align-items-center text-end mt-3 ms-10 ms-md-0">
className="d-none" <div
{...register("attachments")} onClick={() => document.getElementById("attachments").click()}
onChange={(e) => { className="cursor-pointer"
onFileChange(e); style={{ whiteSpace: 'nowrap' }}
e.target.value = ""; >
}} <input
/> type="file"
<i className="bx bx-paperclip"></i> accept=".pdf,.jpg,.jpeg,.png"
Add Attachment id="attachments"
multiple
className="d-none"
{...register("attachments")}
onChange={(e) => {
onFileChange(e);
e.target.value = "";
}}
/>
<i className="bx bx-sm bx-paperclip mb-1 me-1"></i>
Add Attachment
</div>
<button
className="btn btn-primary btn-sm px-1 py-1" // smaller padding + slightly smaller font
type="submit"
disabled={!watch("comment")?.trim() || isPending}
>
<i className="bx bx-xs bx-send me-1"></i>
Submit
</button>
</div> </div>
<button
className="btn btn-primary btn-sm px-3"
type="submit"
disabled={!watch("comment")?.trim() || isPending}
>
<i className="bx bx-send me-1"></i>
Submit
</button>
</div> </div>
{files?.length > 0 && (
<Filelist files={files} removeFile={removeFile} />
)}
</form> </form>
</div> </div>
<div className="card-body p-0"> <div className="card-body p-0">