chore: use typedef instead of inline type

This commit is contained in:
Adrian Castro
2024-02-04 17:38:03 +01:00
parent e88b7d2051
commit 1b9fbb4120
2 changed files with 15 additions and 23 deletions

View File

@@ -2,11 +2,15 @@ import { Image, View } from "react-native";
import { Text } from "~/components/ui/Text";
export default function Item({
data,
}: {
data: { title: string; type: string; year: number; posterUrl: string };
}) {
export interface ItemData {
id: string;
title: string;
type: "movie" | "tv";
year: number;
posterUrl: string;
}
export default function Item({ data }: { data: ItemData }) {
const { title, type, year, posterUrl } = data;
return (