- Updated the `addContact` function to allow all users to add contacts, removing the previous restriction that only masters could do so. - Deleted the `become-master` feature and related utility functions, streamlining the codebase. - Adjusted command settings to reflect the removal of the master role functionality. - Refactored components and hooks to eliminate dependencies on the master role, enhancing user experience and simplifying logic.
29 lines
908 B
TypeScript
29 lines
908 B
TypeScript
'use client';
|
||
|
||
import { DataNotFound } from '../shared/alert';
|
||
import { type SlotComponentProps } from './types';
|
||
import { OrderCard } from '@/components/shared/order-card';
|
||
import { useOrdersQuery } from '@/hooks/api/orders';
|
||
import { LoadingSpinner } from '@repo/ui/components/ui/spinner';
|
||
|
||
export function SlotOrdersList({ documentId }: Readonly<SlotComponentProps>) {
|
||
const { data: { orders } = {}, isLoading } = useOrdersQuery({
|
||
filters: {
|
||
slot: {
|
||
documentId: {
|
||
eq: documentId,
|
||
},
|
||
},
|
||
},
|
||
});
|
||
|
||
return (
|
||
<div className="flex flex-col space-y-2">
|
||
<h1 className="font-bold">Записи</h1>
|
||
{isLoading && <LoadingSpinner />}
|
||
{!isLoading && !orders?.length ? <DataNotFound title="Записи не найдены" /> : null}
|
||
{orders?.map((order) => order && <OrderCard key={order.documentId} {...order} />)}
|
||
</div>
|
||
);
|
||
}
|