feat: добавить рабочий dashboard admin
- добавлен Mantine theme provider и AppShell layout\n- сгенерирован Backend API клиент и добавлены infra/business хуки\n- добавлены таблица assets, detail/presets panels и create asset modal
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { useGetAsset, useGetAssetVariants } from "infra/backend-api"
|
||||
|
||||
import type { AssetOverview } from "../types/assets-api.type"
|
||||
|
||||
/**
|
||||
* Данные выбранного asset и его variants.
|
||||
*/
|
||||
export const useAssetOverview = (publicId: string | null): AssetOverview => {
|
||||
const assetQuery = useGetAsset(publicId)
|
||||
const variantsQuery = useGetAssetVariants(
|
||||
publicId,
|
||||
assetQuery.data?.currentVersion ? String(assetQuery.data.currentVersion) : undefined,
|
||||
)
|
||||
|
||||
return {
|
||||
asset: assetQuery.data ?? null,
|
||||
error: assetQuery.error ?? variantsQuery.error,
|
||||
isLoading: assetQuery.isLoading || variantsQuery.isLoading,
|
||||
variants: variantsQuery.data?.variants ?? [],
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user