Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

refactor(web): type license options (#5907)

authored by yoginth.com and committed by

GitHub fc28aa1c 0154893f

+13 -5
+13 -5
apps/web/src/components/Composer/LicensePicker.tsx
··· 7 7 const LicensePicker = () => { 8 8 const { license, setLicense } = usePostLicenseStore(); 9 9 10 - const otherOptions = Object.values(MetadataLicenseType) 10 + const otherOptions: { 11 + label: string; 12 + selected: boolean; 13 + value: MetadataLicenseType; 14 + }[] = Object.values(MetadataLicenseType) 11 15 .filter((type) => getAssetLicense(type)) 12 16 .map((type) => ({ 13 - label: getAssetLicense(type)?.label as string, 17 + label: getAssetLicense(type)?.label ?? "", 14 18 selected: license === type, 15 19 value: type 16 - })) as any; 20 + })); 17 21 18 - const options = [ 22 + const options: { 23 + label: string; 24 + selected: boolean; 25 + value: MetadataLicenseType | null; 26 + }[] = [ 19 27 { 20 28 label: "All rights reserved", 21 29 selected: license === null, ··· 47 55 </div> 48 56 <Select 49 57 onChange={(value) => setLicense(value as MetadataLicenseType)} 50 - options={options} 58 + options={options as any} 51 59 /> 52 60 <div className="linkify mt-2 text-gray-500 text-sm dark:text-gray-200"> 53 61 {getAssetLicense(license)?.helper ||