first commit
Some checks failed
Build / run (push) Has been cancelled

This commit is contained in:
maher
2025-10-29 11:42:25 +01:00
commit 703f50a09d
4595 changed files with 385164 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import {Channel} from '@common/channels/channel';
import {channelContentConfig} from '@app/admin/channels/channel-content-config';
import {useCookie} from '@common/utils/hooks/use-cookie';
export function useChannelLayouts(channel: Channel) {
const config = channelContentConfig.models[channel.config.contentModel];
const availableLayouts = config?.layoutMethods
.filter(m => channelContentConfig.userSelectableLayouts.includes(m))
.map(method => ({
key: method,
label: channelContentConfig.layoutMethods[method].label,
icon: channelContentConfig.layoutMethods[method].icon,
}));
const [selectedLayout, setSelectedLayout] = useCookie(
`channel-layout-${channel.config.contentModel}`,
channel.config.selectedLayout || channel.config.layout
);
return {selectedLayout, setSelectedLayout, availableLayouts};
}