Talent.com
Registered Nurse

Registered Nurse

vTech SolutionPotsdam, NY, United States
2 days ago
Job type
  • Full-time
  • Quick Apply
Job description

Job Summary : 'use client';

  • import React, { useRef, useState } from 'react';
  • import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '. / ui / card';
  • import { Button } from '. / ui / button';
  • import { Paperclip, Plus, Trash2, FileText, File, FileCode, Loader2 } from 'lucide-react';
  • import { nanoid } from 'nanoid';
  • import { useToast } from '@ / hooks / use-toast';
  • import type { AttachedDocument } from '@ / types';

import { useRouter } from 'next / navigation';

/ / Loading dialog while AI re-analyzes

import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@ / components / ui / dialog';

interface AnalysisLoadingDialogProps {

  • readonly open : boolean;
  • function AnalysisLoadingDialog({ open } : AnalysisLoadingDialogProps) {

    return (

    Analyzing documents

    Our AI is updating the proposal analysis. This may take a moment.

  • );
  • interface AttachedDocumentsProps {

  • readonly docs : AttachedDocument[];
  • readonly setDocs : React.Dispatch;
  • readonly proposalId : string;
  • readonly onRefresh? : () =>

  • Promise;
  • readonly readOnly? : boolean;
  • export function AttachedDocuments({

    docs,

    setDocs,

    proposalId,

    onRefresh,

    readOnly,

    } : AttachedDocumentsProps) {

  • const fileInputRef = useRef(null);
  • const { toast } = useToast();
  • const router = useRouter();
  • const [isAnalyzing, setIsAnalyzing] = useState(false);

    const getFileIcon = (filename : string) =>

  • const ext = filename.split('.').pop()?.toLowerCase();
  • if (!ext) return ;
  • if (['doc', 'docx', 'pdf', 'txt', 'rtf'].includes(ext)) {

  • return ;
  • if (['js', 'ts', 'tsx', 'json', 'py', 'java', 'c', 'cpp', 'cs'].includes(ext)) {

  • return ;
  • return ;
  • };

    const handleFileAdd = async (event : React.ChangeEvent) =>

  • const files = event.target.files;
  • if (!files || files.length === 0) return;

  • const apiUrl = process.env.NEXT_PUBLIC_API_URL;
  • const formData = new FormData();
  • Array.from(files).forEach(file =>

    formData.append('files', file));

    try {

    setIsAnalyzing(true);

    const res = await fetch(`${apiUrl} / api / proposals / ${proposalId} / files`, {

    method : 'POST',

    body : formData,

    });

  • const data = await res.json();
  • if (!res.ok) throw new Error(data.error ?? 'Failed to upload files');

    / / Handle duplicate

    if (data.status === 'duplicate' || data.skippedFiles?.length) {

  • const skippedList = data.skippedFiles?.join(', ') ?? 'Some files';
  • toast({

    title : 'Duplicate file(s) skipped',

    description : `${skippedList} already exist based on first 100 words.`,

    variant : 'destructive',

  • });
  • return;
  • / / Normal upload success

  • const { newFiles, analysis } = data;
  • if (newFiles && newFiles.length >

    0) {

    setDocs(prev =>

  • [...prev, ...newFiles]);
  • document.dispatchEvent(new CustomEvent('analysisUpdated', { detail : analysis }));

    toast({ title : `${newFiles.length} document(s) added and analysis updated.` });

    / / Refresh proposal data dynamically instead of full reload

  • if (onRefresh) await onRefresh();
  • } else {

    toast({

    title : 'No new documents added',

    description : 'File Already Exists.',

    variant : 'destructive',

  • });
  • } catch (err : any) {

    toast({

    variant : 'destructive',

    title : 'Upload Failed',

    description : err.message ?? 'Could not upload files',

  • });
  • } finally {

  • setIsAnalyzing(false);
  • if (fileInputRef.current) fileInputRef.current.value = '';
  • };

    const handleFileDelete = async (docId : string) =>

    try {

    setIsAnalyzing(true);

    const res = await fetch(

    `${process.env.NEXT_PUBLIC_API_URL} / api / proposals / ${proposalId} / files / ${encodeURIComponent(docId)}`,

    { method : 'DELETE' }

    );

  • const data = await res.json();
  • if (!res.ok) throw new Error(data.error ?? 'Failed to delete file');

    / / Update local state

    const newDocs = docs.filter(d =>

  • d.id !== docId);
  • setDocs(newDocs);

    / / If last file deleted delete proposal redirect dashboard

    if (newDocs.length === 0) {

    toast({ title : 'All files removed', description : 'Deleting proposal...' });

    const delRes = await fetch(`${process.env.NEXT_PUBLIC_API_URL} / api / proposals / ${proposalId}`, {

    method : 'DELETE',

    });

    if (!delRes.ok) {

  • const errData = await delRes.json();
  • throw new Error(errData.error ?? 'Failed to delete proposal');
  • toast({

    title : 'Proposal deleted',

    description : 'Redirecting to dashboard...',

    });

    / / Wait a bit, then redirect and reload

    setTimeout(() =>

  • router.push(' / ');
  • window.location.reload();
  • }, 1200);
  • return;
  • / / Notify analysis update

  • document.dispatchEvent(new CustomEvent('analysisUpdated', { detail : data.analysis }));
  • toast({ title : 'File deleted', description : 'Analysis will update shortly.' });

    / /

    Create a job alert for this search

    Registered Nurse • Potsdam, NY, United States

    Related jobs
    • Promoted
    Local Contract Nurse RN - Acute Care - $59-61 per hour

    Local Contract Nurse RN - Acute Care - $59-61 per hour

    WCS Healthcare PartnersOgdensburg, NY, United States
    Full-time
    WCS Healthcare Partners is seeking a local contract nurse RN Acute Care for a local contract nursing job in Ogdensburg, New York. Job Description & Requirements.WCS Healthcare is currently seeking a...Show moreLast updated: 14 days ago
    • Promoted
    Certified Nurse Aide

    Certified Nurse Aide

    St. Lawrence Health SystemCanton, NY, US
    Full-time
    Certified Nurse Aide (1199 CPH) Observation Canton - Potsdam Hospital.The Certified Nurse Aide works under the direct supervision of licensed nursing staff to provide direct patient care in accorda...Show moreLast updated: 30+ days ago
    • Promoted
    Women's Health Nurse Practitioner

    Women's Health Nurse Practitioner

    Rochester Regional HealthGouverneur, US
    Full-time
    Are you an experienced Women's Health Nurse Practitioner ready to make a difference in the lives of women? St.Lawrence Health is seeking a dedicated full-time provider to join our team.Highlights o...Show moreLast updated: 30+ days ago
    • Promoted
    Nursing Assistant - Full time - Massena Hospital

    Nursing Assistant - Full time - Massena Hospital

    St. Lawrence Health SystemMassena, NY, US
    Full-time
    A Nursing Assistant supports patient care by assisting with hygiene, mobility, and basic needs while maintaining a clean, safe environment. They perform tasks like recording vital signs, collecting ...Show moreLast updated: 1 day ago
    • Promoted
    Certified Nurse Aide / Full-time / Canton-Potsdam Hospital

    Certified Nurse Aide / Full-time / Canton-Potsdam Hospital

    St. Lawrence Health SystemCanton, NY, US
    Full-time
    Location : Canton-Potsdam Hospital.Schedule : 11p-7a / 8-hour night shift / every other weekend rotation.The Certified Nurse Aid works under the direct supervision of licensed nursing staff to provid...Show moreLast updated: 18 days ago
    • Promoted
    Certified Nurse Aide / Part time / Canton-Potsdam Hospital

    Certified Nurse Aide / Part time / Canton-Potsdam Hospital

    St. Lawrence Health SystemCanton, NY, US
    Full-time +1
    Certified Nurse Aide (1199 CPH).Location : Canton-Potsdam Hospital.Schedule : 7a-3p, every other weekend.Summary : The Certified Nurse Aid works under the direct supervision of licensed nursing staff ...Show moreLast updated: 18 days ago
    • Promoted
    Registered Nurse (RN) - Corrections

    Registered Nurse (RN) - Corrections

    Cell StaffOgdensburg, NY, US
    Full-time
    FRESH START? If so, we can help YOU! Cell Staff is a nationwide healthcare staffing company that has partnered with Correctional Facilities across your State to help them find AMAZING Nurses.We'...Show moreLast updated: 30+ days ago
    • Promoted
    Certified Nurse Aide - Gouverneur Hospital

    Certified Nurse Aide - Gouverneur Hospital

    St. Lawrence Health SystemGouverneur, NY, US
    Full-time
    Schedule : 12-hour work shift, every other weekend, 8 : 45a - 9 : 15p; and variable.Summary : The Certified Nurse Aide works under the direct supervision of licensed nursing staff to provide direct patie...Show moreLast updated: 30+ days ago
    • Promoted
    Patient Care Technician (PCT)

    Patient Care Technician (PCT)

    WellNow Urgent CareOgdensburg, NY, US
    Full-time
    WellNow Urgent Care Opportunity.WellNow Urgent Care takes pride in creating an environment filled with meaningful work and opportunities by investing in our colleagues. We offer competitive salaries...Show moreLast updated: 30+ days ago
    • Promoted
    Medical Assistant - Massena, NY

    Medical Assistant - Massena, NY

    St. Lawrence Health SystemMassena, NY, US
    Full-time
    The Medical Assistant performs a mixture of both clerical administrative medical assisting, as well as clinical medical office assisting in Primary and / or Specialty care settings.The Certified Medi...Show moreLast updated: 25 days ago
    • Promoted
    Local Contract Nurse RN - Acute Care

    Local Contract Nurse RN - Acute Care

    WCS Healthcare PartnersOgdensburg, NY, US
    Full-time
    WCS Healthcare Partners is seeking a local contract nurse RN Acute Care for a local contract nursing job in Ogdensburg, New York. Job Description & Requirements.WCS Healthcare is currently seeki...Show moreLast updated: 12 days ago
    • Promoted
    Registered Nurse - Step Down

    Registered Nurse - Step Down

    Compunnel IncPotsdam, NY, US
    Full-time
    Job Summary The Registered Nurse - Step Down is responsible for providing high-quality patient care in a step-down unit, with a focus on patients requiring cardiac monitoring and specialized care.T...Show moreLast updated: 4 days ago
    • Promoted
    Caregiver : Flexible Schedule

    Caregiver : Flexible Schedule

    Papa Inc.Heuvelton, NY, US
    Part-time
    Papa is a rewarding service that connects compassionate individuals with older adults and families in need of support in their everyday lives. We're seeking kind-hearted, patient, and caring peo...Show moreLast updated: 30+ days ago
    • Promoted
    Surgical First Assist - PA

    Surgical First Assist - PA

    HealthEcareers - ClientPotsdam, NY, USA
    Full-time
    Are you a skilled Surgical First Assist looking for a rewarding opportunity? St.Lawrence Health is seeking full-time Advance Practice Providers to join our dynamic team!. Combine Surgical First Assi...Show moreLast updated: 30+ days ago
    • Promoted
    Registered Nurse - Intensive Care Unit

    Registered Nurse - Intensive Care Unit

    Compunnel IncPotsdam, NY, US
    Full-time
    Job Summary We are seeking an experienced and compassionate Registered Nurse (RN) to join our Intensive Care Unit (ICU) team. The ICU RN is responsible for providing high-quality, critical care to p...Show moreLast updated: 1 day ago
    • Promoted
    Nursing Assistant (CSEA) - Massena Hospital

    Nursing Assistant (CSEA) - Massena Hospital

    St. Lawrence Health SystemMassena, NY, US
    Full-time
    A Nursing Assistant supports patient care by assisting with hygiene, mobility, and basic needs while maintaining a clean, safe environment. They perform tasks like recording vital signs, collecting ...Show moreLast updated: 14 days ago
    • Promoted
    Nurse Aide

    Nurse Aide

    St. Lawrence Health SystemCanton, NY, US
    Full-time
    Location : Canton-Potsdam Hospital.Schedule : 8-hour night shift, 11p-7a, every other weekend rotation.Summary : The nurse aide works under the direct supervision of licensed nursing staff to provide ...Show moreLast updated: 30+ days ago
    • Promoted
    Women's Health Nurse Practitioner

    Women's Health Nurse Practitioner

    HealthEcareers - ClientGouverneur, NY, USA
    Full-time
    Are you an experienced Women's Health Nurse Practitioner ready to make a difference in the lives of women? St.Lawrence Health is seeking a dedicated full-time provider to join our team.Highlights o...Show moreLast updated: 30+ days ago
    • Promoted
    Certified Surgical Technician - LMH OR •Sign-on Bonus up to $10,000 •

    Certified Surgical Technician - LMH OR •Sign-on Bonus up to $10,000 •

    Yale New Haven HealthClifton, NY, US
    Full-time
    To be part of our organization, every employee should understand and share in the YNHHS Vision, support our Mission, and live our Values. These values - integrity, patient-centered, respect, account...Show moreLast updated: 3 days ago
    • Promoted
    Senior Companionship & Care Aide

    Senior Companionship & Care Aide

    Papa Inc.Heuvelton, NY, US
    Part-time
    Papa is a rewarding service that connects compassionate individuals with older adults and families in need of support in their everyday lives. We're seeking kind-hearted, patient, and caring peo...Show moreLast updated: 30+ days ago