From 52e94e3a7b377f8b58fe439a4286b355bcfb053a Mon Sep 17 00:00:00 2001 From: christinaroise Date: Wed, 25 Sep 2024 09:00:16 +0200 Subject: [PATCH] add ArrayOfObjectsInputProps --- studio/components/LanguageSelector.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/studio/components/LanguageSelector.tsx b/studio/components/LanguageSelector.tsx index 485ac4d5a..4f01602c0 100644 --- a/studio/components/LanguageSelector.tsx +++ b/studio/components/LanguageSelector.tsx @@ -1,17 +1,12 @@ import { Box, Button, Card, Checkbox, Flex, useTheme } from "@sanity/ui"; import React from "react"; -import { PatchEvent, set } from "sanity"; +import { ArrayOfObjectsInputProps, PatchEvent, set } from "sanity"; import { Language, supportedLanguages, } from "internationalization/supportedLanguages"; -interface LanguageSelectorProps { - value?: Language[]; - onChange: (event: PatchEvent) => void; -} - const colorMap = { dark: { selected: "#29356a", @@ -23,7 +18,10 @@ const colorMap = { }, }; -const LanguageSelector = ({ value = [], onChange }: LanguageSelectorProps) => { +const LanguageSelector = ({ + value = [], + onChange, +}: ArrayOfObjectsInputProps) => { const theme = useTheme(); const prefersDark = theme.sanity.v2?.color._dark ?? false; const themeType = prefersDark ? "dark" : "light";