mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-29 14:38:07 +00:00
Some checks failed
🤖 Android APK Build (Phone + TV) / 🏗️ Build Android APK (phone) (push) Has been cancelled
🤖 Android APK Build (Phone + TV) / 🏗️ Build Android APK (tv) (push) Has been cancelled
🤖 iOS IPA Build (Phone + TV) / 🏗️ Build iOS IPA (phone) (push) Has been cancelled
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (actions) (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (javascript-typescript) (push) Has been cancelled
🏷️🔀Merge Conflict Labeler / 🏷️ Labeling Merge Conflicts (push) Has been cancelled
🚦 Security & Quality Gate / 📝 Validate PR Title (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Vulnerable Dependencies (push) Has been cancelled
🚦 Security & Quality Gate / 🚑 Expo Doctor Check (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (check) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (format) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (lint) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (typecheck) (push) Has been cancelled
🕒 Handle Stale Issues / 🗑️ Cleanup Stale Issues (push) Has been cancelled
53 lines
1.7 KiB
TypeScript
53 lines
1.7 KiB
TypeScript
import { router, useSegments } from "expo-router";
|
|
import type React from "react";
|
|
import { useCallback } from "react";
|
|
import { TouchableOpacity, type ViewProps } from "react-native";
|
|
import GenericSlideCard from "@/components/jellyseerr/discover/GenericSlideCard";
|
|
import Slide, { type SlideProps } from "@/components/jellyseerr/discover/Slide";
|
|
import { useJellyseerr } from "@/hooks/useJellyseerr";
|
|
import {
|
|
COMPANY_LOGO_IMAGE_FILTER,
|
|
type Network,
|
|
} from "@/utils/jellyseerr/src/components/Discover/NetworkSlider";
|
|
import type { Studio } from "@/utils/jellyseerr/src/components/Discover/StudioSlider";
|
|
|
|
const CompanySlide: React.FC<
|
|
{ data: Network[] | Studio[] } & SlideProps & ViewProps
|
|
> = ({ slide, data, ...props }) => {
|
|
const segments = useSegments();
|
|
const { jellyseerrApi } = useJellyseerr();
|
|
const from = (segments as string[])[2] || "(home)";
|
|
|
|
const navigate = useCallback(
|
|
({ id, image, name }: Network | Studio) =>
|
|
router.push({
|
|
pathname: `/(auth)/(tabs)/${from}/jellyseerr/company/${id}` as any,
|
|
params: { id, image, name, type: slide.type },
|
|
}),
|
|
[slide],
|
|
);
|
|
|
|
return (
|
|
<Slide
|
|
{...props}
|
|
slide={slide}
|
|
data={data}
|
|
keyExtractor={(item) => item.id.toString()}
|
|
renderItem={(item, _index) => (
|
|
<TouchableOpacity className='mr-2' onPress={() => navigate(item)}>
|
|
<GenericSlideCard
|
|
className='w-28 rounded-lg overflow-hidden border border-neutral-900 p-4'
|
|
id={item.id.toString()}
|
|
url={jellyseerrApi?.imageProxy(
|
|
item.image,
|
|
COMPANY_LOGO_IMAGE_FILTER,
|
|
)}
|
|
/>
|
|
</TouchableOpacity>
|
|
)}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default CompanySlide;
|