/
githubmirror
/
trpc
Обзор
Документация
Войти
/
githubmirror
/
trpc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
www/src/components/Iframe.tsx
22 строки
541 B
Alex / KATT
chore: add `consistent-type-(imports|exports)` lint rules (#5274)
08 янв 2024, 01:33
Не верифицирован
08 янв 2024, 01:33
b93149c
Код
Авторство
О чём код?
import clsx from 'clsx'; import type { ComponentPropsWithoutRef } from 'react'; import React, { useState } from 'react'; export const Iframe = ( props: Omit<ComponentPropsWithoutRef<'iframe'>, 'className'>, ) => { const [loaded, setLoaded] = useState(false); return ( <iframe loading="lazy" {...props} onLoad={() => { setLoaded(true); }} className={clsx( 'absolute h-full w-full transition-opacity duration-1000', loaded ? 'opacity-100' : 'opacity-0', )} /> ); };