'use client';

import { type OrderComponentProps } from './types';
import { getAlert } from '@/components/shared/status';
import { useOrderQuery } from '@/hooks/api/orders';

export function OrderStatus({ documentId }: Readonly<OrderComponentProps>) {
  const { data: { order } = {} } = useOrderQuery({ documentId });

  return order?.state && getAlert(order.state);
}
