Skip to content

Commit

Permalink
useless file removed
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinBouzinFiligran committed Jan 17, 2025
1 parent 248dc19 commit 8efeb97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Paper from '@mui/material/Paper';
import IconButton from '@mui/material/IconButton';
import { ZoomOutMapOutlined } from '@mui/icons-material';
import Box from '@mui/material/Box';
import { IntrusionSetDetails_intrusionSet$data } from '@components/threats/intrusion_sets/__generated__/IntrusionSetDetails_intrusionSet.graphql';
import { convertImagesToCarousel } from '../utils/edition';
import type { Theme } from './Theme';
import { isNotEmptyField } from '../utils/utils';
Expand Down Expand Up @@ -69,7 +68,9 @@ export interface ImagesData {
}

interface ImageCarouselProps {
data: IntrusionSetDetails_intrusionSet$data
data: {
images: ImagesData | null;
};
}

interface CarouselImage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ExpandableMarkdown from '../../../../components/ExpandableMarkdown';
import { useFormatter } from '../../../../components/i18n';
import IntrusionSetLocations from './IntrusionSetLocations';
import ItemOpenVocab from '../../../../components/ItemOpenVocab';
import ImageCarousel from '../../../../components/ImageCarousel';
import ImageCarousel, { ImagesData } from '../../../../components/ImageCarousel';
import FieldOrEmpty from '../../../../components/FieldOrEmpty';

type IntrusionSetDetailsProps = {
Expand All @@ -25,6 +25,12 @@ const IntrusionSetDetailsComponent = ({ intrusionSet }: IntrusionSetDetailsProps
const { t_i18n, fldt } = useFormatter();
const theme = useTheme();

const imagesCarousel: { images: ImagesData } = {
images: {
edges: (intrusionSet.images?.edges ?? []).filter((n) => n?.node?.metaData?.inCarousel),
} as ImagesData,
};

const hasImages = intrusionSet.images?.edges && intrusionSet.images.edges.filter((n) => (
n?.node?.metaData?.inCarousel
)).length > 0;
Expand All @@ -48,7 +54,7 @@ const IntrusionSetDetailsComponent = ({ intrusionSet }: IntrusionSetDetailsProps
<Grid container spacing={3}>
{hasImages && (
<Grid item xs={4}>
<ImageCarousel data={intrusionSet} />
<ImageCarousel data={imagesCarousel} />
</Grid>
)}
<Grid item xs={hasImages ? 8 : 12}>
Expand Down

0 comments on commit 8efeb97

Please sign in to comment.