import { Dropdown, Item } from 'react-basics'; import useApi from 'components/hooks/useApi'; import useMessages from 'components/hooks/useMessages'; import styles from './WebsiteSelect.module.css'; export function WebsiteSelect({ websiteId, onSelect, }: { websiteId: string; onSelect?: (key: any) => void; }) { const { formatMessage, labels } = useMessages(); const { get, useQuery } = useApi(); const { data } = useQuery({ queryKey: ['websites:me'], queryFn: () => get('/me/websites', { pageSize: 100 }), }); const renderValue = value => { return data?.data?.find(({ id }) => id === value)?.name; }; return ( {({ id, name }) => {name}} ); } export default WebsiteSelect;