MCPcopy Create free account
hub / github.com/dailydotdev/apps / RowChip

Function RowChip

packages/shared/src/components/shell/ShellRow.tsx:179–228  ·  view source on GitHub ↗
({
  item,
  className,
  content,
}: {
  item: RowItem;
  className: string;
  content: ReactNode;
})

Source from the content-addressed store, hash-verified

177);
178
179const RowChip = ({
180 item,
181 className,
182 content,
183}: {
184 item: RowItem;
185 className: string;
186 content: ReactNode;
187}): ReactElement => {
188 if (item.href) {
189 return (
190 <Link
191 href={item.href}
192 passHref
193 replace={item.replace}
194 scroll={item.keepScroll ? false : undefined}
195 >
196 <a
197 aria-label={item.ariaLabel}
198 aria-current={item.active ? 'page' : undefined}
199 onClick={item.onClick}
200 // eslint-disable-next-line jsx-a11y/no-redundant-roles
201 role="link"
202 tabIndex={0}
203 onKeyDown={(event) => {
204 if (event.key === ' ') {
205 event.preventDefault();
206 event.currentTarget.click();
207 }
208 }}
209 className={className}
210 >
211 {content}
212 </a>
213 </Link>
214 );
215 }
216
217 return (
218 <button
219 type="button"
220 aria-label={item.ariaLabel}
221 aria-pressed={item.active}
222 onClick={item.onClick}
223 className={className}
224 >
225 {content}
226 </button>
227 );
228};
229
230export const Segments = ({ items }: { items: RowItem[] }): ReactElement => (
231 <>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected