@@ -57,6 +57,11 @@ const ArticleTab: React.FC<ArticleTabProps> = ({ funcPublish, funcScraper }) =>
5757 await storage . set ( 'articlePlatforms' , newSelectedPlatforms ) ;
5858 } ;
5959
60+ const clearSelectedPlatforms = async ( ) => {
61+ setSelectedPlatforms ( [ ] ) ;
62+ await storage . set ( 'articlePlatforms' , [ ] ) ;
63+ } ;
64+
6065 const loadPlatforms = async ( ) => {
6166 const platforms = await storage . get < string [ ] > ( "articlePlatforms" ) ;
6267 setSelectedPlatforms ( platforms as string [ ] || [ ] ) ;
@@ -344,7 +349,7 @@ const ArticleTab: React.FC<ArticleTabProps> = ({ funcPublish, funcScraper }) =>
344349 isIconOnly
345350 size = "sm"
346351 color = "danger"
347- className = "absolute top-0 right-0 z-50 m-1 opacity-0 transition-opacity group-hover:opacity-100"
352+ className = "absolute top-0 right-0 z-50 m-1 transition-opacity opacity-0 group-hover:opacity-100"
348353 onPress = { handleDeleteCover } >
349354 < XIcon className = "size-4" />
350355 </ Button >
@@ -383,9 +388,24 @@ const ArticleTab: React.FC<ArticleTabProps> = ({ funcPublish, funcScraper }) =>
383388 </ CardBody >
384389 </ Card >
385390
386- < div className = "flex flex-col gap-4 bg-default-50 p-4 rounded-lg" >
391+ < div className = "flex flex-col gap-4 p-4 rounded-lg bg-default-50 " >
387392 < div className = "flex flex-col gap-2" >
388- < p className = "text-sm font-medium" > { chrome . i18n . getMessage ( 'optionsSelectPublishPlatforms' ) } </ p >
393+ < div className = "flex items-center justify-between" >
394+ < div className = "flex items-center gap-2" >
395+ < p className = "text-sm font-medium" > { chrome . i18n . getMessage ( 'optionsSelectPublishPlatforms' ) } </ p >
396+ </ div >
397+ { selectedPlatforms . length > 0 && (
398+ < Button
399+ size = "sm"
400+ variant = "light"
401+ color = "danger"
402+ onPress = { clearSelectedPlatforms }
403+ className = "text-xs"
404+ >
405+ { chrome . i18n . getMessage ( 'optionsClearPlatforms' ) || chrome . i18n . getMessage ( 'optionsClearAll' ) || '清空平台' }
406+ </ Button >
407+ ) }
408+ </ div >
389409 < div className = "grid grid-cols-2 gap-3" >
390410 { getPlatformInfos ( 'ARTICLE' ) . map ( ( platform ) => (
391411 < PlatformCheckbox
@@ -403,7 +423,7 @@ const ArticleTab: React.FC<ArticleTabProps> = ({ funcPublish, funcScraper }) =>
403423 onPress = { handlePublish }
404424 color = "primary"
405425 disabled = { ! title || selectedPlatforms . length === 0 }
406- className = "px-4 py-2 w-full font-bold" >
426+ className = "w-full px-4 py-2 font-bold" >
407427 { chrome . i18n . getMessage ( 'optionsSyncArticle' ) }
408428 </ Button >
409429
@@ -423,7 +443,7 @@ const ArticleTab: React.FC<ArticleTabProps> = ({ funcPublish, funcScraper }) =>
423443 < h4 className = "mb-2 font-semibold" > { importedContent . title } </ h4 >
424444 < p className = "mb-4 text-sm" > { importedContent . digest } </ p >
425445 < div
426- className = "max-w-none prose "
446+ className = "prose max-w-none"
427447 dangerouslySetInnerHTML = { { __html : importedContent . content } }
428448 />
429449 </ CardBody >
0 commit comments