/*
    ! /actions/.templateAction.js
    ? Action socket.io handler template.
*/

// % export default action function
export default async function handleAction(socket, dbWorker, data) {
    // $ Business logic for processing the chat message
    console.log(`Received message from ${socket.id}:`, data.message);

    // $ Respond back to the client or broadcast
    socket.emit('chat.response', { status: 'success', text: 'Message received!' });
}