feat(ui): finalize E-TIB modernization with footer redesign, video optimization, and TS fixes
Former-commit-id: 67ac02c8404cc66893fdf97308574701cca6000c
This commit is contained in:
@@ -1,43 +1,35 @@
|
||||
import React from 'react';
|
||||
import { getPayload } from 'payload';
|
||||
import configPromise from '@payload-config';
|
||||
import * as React from 'react';
|
||||
import { TeamGrid as TeamGridComponent } from './TeamGrid';
|
||||
|
||||
export interface TeamMember {
|
||||
id: string;
|
||||
name: string;
|
||||
position: string;
|
||||
email?: string | null;
|
||||
phone?: string | null;
|
||||
image?: { url: string; alt?: string } | string | null;
|
||||
branch: string;
|
||||
}
|
||||
|
||||
export interface TeamGridBlockProps {
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
filterBranch?: string;
|
||||
department?: string;
|
||||
showContact?: boolean;
|
||||
}
|
||||
|
||||
export const TeamGridBlock = async (props: TeamGridBlockProps) => {
|
||||
const { title, subtitle, filterBranch } = props;
|
||||
const payload = await getPayload({ config: configPromise });
|
||||
|
||||
const query: any = {
|
||||
collection: 'team',
|
||||
limit: 100,
|
||||
depth: 1,
|
||||
};
|
||||
|
||||
if (filterBranch && filterBranch !== 'all') {
|
||||
query.where = {
|
||||
branch: {
|
||||
equals: filterBranch,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const { docs: teamMembers } = await payload.find(query);
|
||||
|
||||
// Map Payload docs to TeamGrid expected format
|
||||
export const TeamGridBlock = async ({ title, department, showContact = true }: TeamGridBlockProps) => {
|
||||
// Static fallback since Payload CMS is removed
|
||||
const teamMembers: any[] = [];
|
||||
|
||||
// Map docs to TeamGrid expected format
|
||||
const members = teamMembers.map((m: any) => ({
|
||||
id: m.id,
|
||||
name: m.name,
|
||||
position: m.position,
|
||||
position: m.role || m.position || '',
|
||||
branch: m.department || m.branch || 'e-tib',
|
||||
email: m.email,
|
||||
phone: m.phone,
|
||||
image: m.image,
|
||||
branch: m.branch,
|
||||
}));
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user