import { ImageBackground as EImageBackground } from "expo-image";
import { LinearGradient, type LinearGradientProps } from "expo-linear-gradient";
import type { ComponentProps, ReactNode } from "react";
import type { ImageStyle } from "react-native";
import { Platform } from "react-native";
import { useYoshiki } from "yoshiki/native";
import type { KImage } from "~/models";
import { useToken } from "~/providers/account-context";
import type { ImageLayout, YoshikiEnhanced } from "./image";
// This should stay in think with `Image`.
// (copy-pasted but change `EImage` with `EImageBackground`)
// ALSO, remove `border-radius` (it's weird otherwise)
export const ImageBackground = ({
src,
quality,
alt,
layout,
...props
}: {
src: KImage | null;
quality: "low" | "medium" | "high";
alt?: string;
style?: ImageStyle;
layout: ImageLayout;
children: ReactNode;
}) => {
const { css } = useYoshiki();
const { apiUrl, authToken } = useToken();
return (
);
};
export const PosterBackground = ({
alt,
layout,
...props
}: Omit, "layout"> & {
style?: ImageStyle;
layout: YoshikiEnhanced<
{ width: ImageStyle["width"] } | { height: ImageStyle["height"] }
>;
}) => {
const { css } = useYoshiki();
return (
);
};
export const GradientImageBackground = ({
gradient,
gradientStyle,
children,
...props
}: ComponentProps & {
gradient?: Partial;
gradientStyle?: Parameters["css"]>[0];
}) => {
const { css, theme } = useYoshiki();
return (
{children}
);
};