w-aura/src/legal/utils.ts
Aidar Shaikhutdin @makeweb.space 944d7210f7 feat: add static pages
2023-05-21 09:15:10 +06:00

8 lines
276 B
TypeScript

import { Elements } from '../api'
const isMain = (element: Elements.ElementGroup) => element.name === 'main'
export const buildLegal = (resp: Elements.Response): Elements.ElementGroupItem[] => {
const element = resp.data.groups.find(isMain)
return element?.items || []
}