mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: custom components
This commit is contained in:
1 parent
bc6bb4f10e
commit
69b13fd33a
9 files changed
+164
-58
No files matched your search
@@ -1,6 +1,6 @@
|
||||
---
|
||||
import { CatalogItemsComponent } from '@protos/blitz_static_catalog_items_group_component';
|
||||
import { TestComponent } from '../../../components/TestComponent';
|
||||
import { BlitzKitAllTankEntities } from '@protos/blitzkit_static_all_tank_entities';
|
||||
import { unpackedMetadata } from '../../../core/blitz/unpackedMetadata';
|
||||
export { getStaticPaths } from '../index.astro';
|
||||
|
||||
@@ -9,6 +9,15 @@ const { locale } = Astro.props;
|
||||
const allTanks = unpackedMetadata
|
||||
.get('CatalogItemsGroupEntity.all_tanks')
|
||||
.get(CatalogItemsComponent, 'catalogItemsGroupComponent');
|
||||
|
||||
const allTankEntities = unpackedMetadata
|
||||
.get('BlitzKitAllTankEntities.all_tanks')
|
||||
.get(BlitzKitAllTankEntities, 'blitzkitAllTankEntitiesComponent');
|
||||
---
|
||||
|
||||
<TestComponent />
|
||||
<pre>
|
||||
{JSON.stringify(allTankEntities.tanks.map(tank=>({
|
||||
tank: tank.catalog_id,
|
||||
components: tank.components.map(component=>component.key)
|
||||
})), null, 2)}
|
||||
</pre>
|
||||
@@ -1,14 +0,0 @@
|
||||
import locales from '@blitzkit/i18n/locales.json' with { type: 'json' };
|
||||
import type { APIRoute, GetStaticPaths, GetStaticPathsItem } from 'astro';
|
||||
import { getStrings } from 'packages/website-ue/src/core/i18n/getStrings';
|
||||
|
||||
export const getStaticPaths: GetStaticPaths = () => {
|
||||
return locales.supported.map(
|
||||
({ locale }) => ({ params: { locale } }) satisfies GetStaticPathsItem,
|
||||
);
|
||||
};
|
||||
|
||||
export const GET: APIRoute = async ({ params, request }) => {
|
||||
const strings = await getStrings(params.locale!);
|
||||
return Response.json(strings);
|
||||
};
|
||||
Reference in new issue
Block a user